Peter Whittingham’s injury-time penalty earned Cardiff a dramatic win against relegated Bolton to revive their Championship play-off hopes.
Zach Clough’s free-kick gave Bolton a surprise lead, but they had Niall Maher sent off for elbowing Craig Noone.
Kenneth Zohore levelled as Cardiff dominated the second half but squandered several chances.
However, Whittingham kept his cool after Kadeem Harris was fouled by Tyler Garrett.
Cardiff closed the gap on sixth-placed Sheffield Wednesday to four points with two games left.
The Bluebirds face Wednesday at Hillsborough next Saturday, and a victory for Russell Slade’s side will take the race for the final play-off place down to the last weekend of the season.
Wednesday’s 1-1 draw at Derby earlier on Saturday meant Cardiff started this game seven points behind the play-off spots.
The Bluebirds knew defeat would end their fading hopes of finishing in the top six, and those aspirations were on the brink of being extinguished after just seven minutes.
Bolton’s veteran former England striker Emile Heskey was fouled by Lee Peltier on the edge of Cardiff’s penalty area and, from the resulting free-kick, Clough delicately curled the ball into the top corner.
The goal stunned an expectant Cardiff City Stadium into silence, save for the small pocket of jubilant Bolton fans hoping for a first away win of the season.
Cardiff enjoyed as much as 80% possession at times but did little with it, even if their hopes were raised when Bolton’s Maher was shown a straight red card for a reckless elbow to the head of Noone.
The Bluebirds winger was fine to continue and it was his mazy run from his own half which set up Zohore to equalise with a low strike.
The hosts were in total control from that point, monopolising possession but spurning numerous chances as Sammy Ameobi and Stuart O’Keefe missed from promising positions.
Cardiff’s perseverance was rewarded when substitute Harris was brought down in the Bolton penalty area, giving Whittingham the chance to whip the ball beyond Ben Amos in the visitors’ goal and spark wild celebrations among the home fans.
Cardiff City manager Russell Slade:
“We left it late, if I had any hair, it would all be gone.
“Our chances are still slim, but probably not as slim as they were before a ball was kicked.
“The gap is now four points, and we have a cup final next weekend. We need to dust ourselves down and be ready for it.
“I’ve always said that if we can take it to the last game of the season, at home, then we would take that.”
Bolton Wanderers caretaker manager Jimmy Phillips:
“The sending off made it difficult, but it’s great that we have come into an away game and got the first goal. It was a fantastic free-kick from Zach Clough.
“I thought we kept a good disciplined shape when we were down to 10 men. We then had three good opportunities – the best of the half – but we didn’t manage to stick one in the net.
“I feel it’s important the club appoints a new manager soon. Whoever does get the job has to decide which players need replacing. The sooner we start that process, the better.”