Substitute Grant McCann scored two penalty kicks to earn Peterborough United a remarkable 2-1 victory over league leaders Cardiff City at London Road.
Dwight Gayle tested goalkeeper Marshall in the opening seven minutes, but his low shot was straight at the Bluebirds skipper after a good link with Lee Tomlin.
Peter Whittingham fired straight at Olejnik after a throw-in from Gunnarsson was only half cleared, while Gayle arrowed a shot wide with his left-foot from long range at the other end.
The deadlock was broken on 23 minutes as a corner was only half cleared and GUNNARSSON poked home from close-range past Olejnik.
Tomlin tested Marshall with a shot on the turn after a Rowe throw in as Posh tried to get back into the game, which had became scrappy in difficult conditions.
Posh had appeals for a spot-kick turned down as Ferdinand appeared to be pushed in the box, but referee Mr Ilderton waved away the protests.
Zakuani glanced a header wide of the far post from a Tomlin free-kick as Posh ended the half well.
Ferdinand headed straight at Marshall from a Newell centre on 50 minutes as Ferguson sent substitutes to warm up.
Mendez-Laing replaced Newell on 54 minutes. The substitute headed wide on 64 minutes, but Posh were struggling to break down a stubborn Cardiff defence.
Grant MCCANN replaced Ferdinand in midfield and moments later the Northern Irishman was on the score-sheet, converting from the spot after Little had been upended by Cowie.
Conway flashed a shot right across goal after Barnett's long-range struck Alcock as the action immediately switched to the other end.
Posh were awarded a second spot kick on 79 minutes as Gayle was felled by Connolly and up stepped McCANN again to send the keeper the wrong way and make it 2-1 to the hosts.
In the dying seconds, Gestede headed over before the referee brought an end to proceedings with the Posh fans providing a standing ovation for a monumental effort against the league leaders.
Final Score: Posh 2-1 Cardiff City
Posh: Olejnik, Little, Rowe, Alcock, Knight-Percival, Zakuani, Payne, Newell (sub Mendez-Laing 54min), Ferdinand, Gayle, Tomlin (sub Barnett 90min). Unused subs: Day, Brisley, Swanson, Cuvelier.
Cardiff: Marshall, Taylor, Turner, Whittingham (sub Conway 67min), Cowie, Connolly, Smith, Gunnarsson, Helguson (sub Mason 77min), Barnett, Campbell (sub Gestede 58min). Unused subs: Lewis, McNaughton, Bo-Kyung, Mutch.
Attendance: 9,236 (2,171 Cardiff fans)