Peterborough extended their unbeaten run to six matches as they left the relegation places behind by completing the double over npower Championship leaders Cardiff with a 2-1 win.
Two Grant McCann penalties in the last 18 minutes were enough for Darren Ferguson's side as they battled back from a goal down to claim a dramatic win.
The hosts did it the hard way, though, and lacked the services of Michael Bostwick, who had not recovered from a hamstring injury to take his place in the Posh side.
But new loan signing Florent Cuvelier was among the substitutes for Ferguson after signing from Stoke on Wednesday.
Jordon Mutch was a welcome inclusion on the bench for visiting manager Malky Mackay, although Craig Bellamy and skipper Mark Hudson were sidelined.
The leaders were forced on the defensive at the start as Posh went close through Dwight Gayle, whose shot from 18 yards was well held by Cardiff goalkeeper David Marshall - making his 300th club career start.
Cardiff made their presence felt after 17 minutes when Peter Whittingham tried his luck from the edge of the penalty area, Robert Olejnik making the save in the Posh goal.
But the Peterborough stopper was picking the ball out of the net only six minutes later when the visitors won a corner and the ball broke for Heidar Helguson to supply the cross for Aron Gunnarsson to finish from close range for his eighth goal of the campaign.
Whittingham went close to making it two shortly after but his shot cleared the crossbar as Mackay's men turned the screw and looked for a second.
Peterborough were rattled but two efforts from Lee Tomlin had the home fans believing that all was not lost for their side.
Posh continued to press after the break and after 49 minutes, Joe Newell's cross was met by Kane Ferdinand, whose header brought a fine stop from Marshall.
Ten minutes later Craig Alcock latched onto a corner from Tomlin but his effort from 12 yards cleared the crossbar.
Posh were asking big questions of Cardiff but when they finally drew level after 72 minutes, it was from the penalty spot.
When Don Cowie fouled Mark Little in the box, McCann - who had only entered the action two minutes earlier as a 70th-minute replacement for Ferdinand - showed few signs of nerves when he blasted home from the spot.
It was no more than Ferguson's side deserved and it got even better for the hosts seven minutes later when Matthew Connolly fouled Gayle in the box and McCann again despatched the penalty.
Cardiff had chances in the closing stages but Peterborough held on to claim a valuable three points.