Abdul Razzaq smashed Pakistan to an incredible one-wicket victory over South Africa in the second one-day international.
Set a target of 287 in Abu Dhabi, Pakistan looked doomed after slipping to 257-9 with just 15 balls remaining.
With only last man Shoaib Akhtar for company, Razzaq threw caution to the wind and saw his side to their target with one delivery to spare.
Needing 14 off the final over, Razzaq went to his century with consecutive sixes off medium pacer Albie Morkel (0-52).
The all-rounder then survived a caught behind appeal before blazing the penultimate ball through the off-side to clinch victory and snap South Africa's 10-match winning streak in the format.
Razzaq finished unbeaten on 109 from 72 balls, including 10 sixes and seven fours. Shoaib (0no) faced only one delivery, which he blocked, during a 10th-wicket stand of 32.
Pakistan had recovered from 70-4 thanks to solid contributions from Fawad Alam (48) and Shahid Afridi (49) but a trio of run outs looked to have ended their chance before Razzaq's heroics.
Earlier, Colin Ingram continued his superb start in international cricket with another century as South Africa posted a score of 286-6 after opting to bat first at the Sheikh Zayed Stadium.
After Robin Peterson (6) was bowled by Razzaq (1-37) in the fourth over, number three Ingram shared stands worth 83 with Hashim Amla (65) and 86 alongside AB de Villiers (29).
The Warriors left-hander, who marked his debut earlier in October with 124 against Zimbabwe, went to three figures for the second time in four one-day international innings from 118 balls.
He failed to add any more, however, as Wahab Riaz (2-43) trapped him lbw to leave South Africa 216-4 in the 41st over but JP Duminy (54) added quick runs at the death.
The five-match series is now level at 1-1 ahead of the third instalment in Dubai on November 2.