Match ends, Cardiff City 2, Bolton Wanderers 1.
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."
- 4MorrisonBooked at 30mins
- 16ConnollySubstituted forK Harrisat 80'minutes
- 8RallsSubstituted forAmeobiat 45'minutes
- 26ZohoreSubstituted forLawrenceat 66'minutes
- 24K Harris
- 48MaherBooked at 31mins
- 21PratleySubstituted forGarrettat 34'minutes
- 19HeskeySubstituted forWooleryat 58'minutes
- Lee Collins
- Shots on Target
Second Half ends, Cardiff City 2, Bolton Wanderers 1.
Goal! Cardiff City 2, Bolton Wanderers 1. Peter Whittingham (Cardiff City) converts the penalty with a left footed shot to the bottom right corner.
Penalty Cardiff City. Kadeem Harris draws a foul in the penalty area.
Penalty conceded by Tyler Garrett (Bolton Wanderers) after a foul in the penalty area.
Stuart O'Keefe (Cardiff City) wins a free kick in the attacking half.
Foul by Neil Danns (Bolton Wanderers).
Corner, Bolton Wanderers. Conceded by David Marshall.
Attempt saved. Zach Clough (Bolton Wanderers) left footed shot from the left side of the box is saved in the top left corner. Assisted by Josh Vela.
Scott Malone (Cardiff City) wins a free kick in the defensive half.
Foul by Josh Vela (Bolton Wanderers).
Attempt saved. Kaiyne Woolery (Bolton Wanderers) right footed shot from the centre of the box is saved in the centre of the goal. Assisted by Oscar Threlkeld.
Attempt blocked. Tom Lawrence (Cardiff City) right footed shot from the left side of the box is blocked. Assisted by Anthony Pilkington.
Foul by Stuart O'Keefe (Cardiff City).
Kaiyne Woolery (Bolton Wanderers) wins a free kick in the defensive half.
Corner, Cardiff City. Conceded by Tyler Garrett.
Attempt blocked. Anthony Pilkington (Cardiff City) left footed shot from outside the box is blocked.
Attempt missed. Sean Morrison (Cardiff City) header from the centre of the box misses to the left. Assisted by Peter Whittingham with a cross following a corner.
Corner, Cardiff City. Conceded by Ben Amos.
Attempt saved. Craig Noone (Cardiff City) header from the centre of the box is saved in the top left corner. Assisted by Kadeem Harris with a cross.