Craig Conway produced a sensational injury-time winner as Cardiff City fought back from 2-1 down to see off Portsmouth in the Championship.
Kenny Miller opened the scoring from an acute angle before home goalkeeper David Marshall spilled the ball for Marko Futacs to pounce.
After the break, Greg Halford put Portsmouth ahead from close range.
But Cardiff skipper Mark Hudson headed in to level and Conway hit a ferocious 35-yard winner in extra time.
Mackay hails Conway's winner
Miller hit home from the most acute of angles to beat Pompey goalkeeper Stephen Henderson from Peter Whittingham's cross as Cardiff underlined their early dominance.
The Bluebirds had other chances for Darcy Blake, Miller and Joe Mason but the visitors were level after Marshall failed to secure a bouncing ball, with Hungarian Futacs levelling.
Pompey went in front three minutes into the second half when Halford spun around from Liam Lawrence's corner to hit home.
As the hosts sought an equaliser, Hudson came out of defence to head home from Conway's cross.
And the provider turned finisher with a brilliant strike as Cardiff maintained their push for promotion with a fifth successive unbeaten game in the league.
However, the home side's fightback condemned Pompey to a third successive league defeat.
Cardiff City 01 Marshall 03 Taylor 05 Hudson 25 Turner 07 Whittingham 08 Cowie 11 Conway 17 Gunnarsson 23 Blake 09 Miller 20 Mason Substitutes 22 Heaton 14 Quinn 04 Kiss 37 McPhail 10 Earnshaw Portsmouth 13 Henderson 02 Ward 05 Pearce 15 Halford 26 Ben-Haim 07 Lawrence 08 Mullins 10 Huseklepp (Webster - 88' ) 09 Futacs Booked 14 Etuhu (Mwaruwari - 64' ) 18 Kitson Substitutes 01 Ashdown 03 Rocha 17 Williams 31 Webster 25 Mwaruwari