Pakistan opener Fakhar Zaman hit a stunning 193 but could not prevent South Africa winning the second one-day international by 17 runs.
Chasing 342 to win in Johannesburg, the tourists fell to 205-7 in the 38th over before Fakhar’s amazing performance.
He struck 18 fours and 10 sixes in his 155-ball innings before he was run out by a direct hit in the final over, with Pakistan ending on 324-9.
The series is tied at 1-1, with the final ODI at Centurion on Wednesday.
Pakistan captain Babar Azam said Fakhar’s knock was “one of the best innings” ever, while South Africa counterpart Temba Bavuma said it was “incredible” and “probably the best” he had seen.
Left-hander Fakhar, 30, was run out in strange fashion on the first ball of the final over as he attempted a second run.
South Africa wicketkeeper Quinton de Kock appeared to gesture for Aiden Markram to throw to the bowler’s end from long off and Fakhar slowed down as he looked over his shoulder, leaving him a metre short as the ball hit the stumps at the striker’s end.
The laws of cricket state a fielder should not “wilfully attempt, by word or action, to distract, deceive or obstruct either batsman” after a delivery.
If the umpires deem ‘fake fielding’ has taken place, the penalty is to call a dead ball and award the batting team five runs as well as any runs in progress.
Pakistan started the final over needing an unlikely 31 runs to win, but had the umpires penalised South Africa under this law, it would have left the tourists needing 24 off six balls.
Fakhar said the run out was “my fault” and that he “should’ve kept my eyes on the ball” but was looking at Haris Rauf because he was worried his batting partner had set off late.
South Africa posted 341-6 thanks to half-centuries from Bavuma (92), De Kock (80), Rassie van der Dussen (60) and David Miller (50 not out).
After the early loss of Imam-ul-Haq, Fakhar and Babar guided Pakistan to 70-1 before Proteas fast bowler Anrich Nortje took three quick wickets to leave the tourists struggling on 85-4.
Fakhar received some lower-order support but the game appeared to be over once number eight Faheem Ashraf fell, with Fakhar then on 97 from 105 balls.
He added 96 from his next 50 balls, including three consecutive sixes off left-arm wrist-spinner Tabraiz Shamsi, but South Africa’s total proved enough.