Fakhar Zaman's scintillating 193 proved not enough for Pakistan who lost the second one-day international to South Africa by 17 runs at The Wanderers as the hosts levelled the three-game series.
Fakhar was left to do it all on his own on Sunday as Pakistan reached 9-324 in reply to South Africa's 6-341.
His power-hitting included 18 fours and 10 sixes for the record score in ODIs in Johannesburg, beating the 175 by Herschelle Gibbs against Australia in 2006.
But Pakistan still fell short as Temba Bavuma, who scored a superb 92 from 102 balls, enjoyed his first victory in his historic role as South Africa's first Black captain .
Fakhar's was the best score ever by a visiting player to South Africa, and what made it even more remarkable was that the next highest contribution in Pakistan's innings was 31 from captain Babar Azam.
His magnificent innings of 155 balls ended in the most bizarre fashion when he cantered home for a second run off the first ball of the final over.
Yet a throw from the fence by Aiden Markram proved a direct hit and the batsman's excellent chance for a second double-ton in the 50-over format was gone.
The tourists had elected to field first and South Africa's impressive total was boosted by four fine half-centuries, each different in their make-up.
Newly-appointed captain Temba Bavuma scored 92 from 102 balls and warmed to his task as the innings wore on, while opener Quinton de Kock looked edgy and had luck in his 80 from 86 balls.
Rassie van der Dussen, who got a century in the first match in Pretoria on Friday, kept up his good form with a powerful 60 from 37 balls that included four sixes, before David Miller finished the innings with 50 not out from 27 balls.
Seamer Haris Rauf was comfortably the pick of the Pakistan bowlers with 3-54 from his 10 overs.
The third and final ODI is scheduled for Pretoria on Wednesday but South Africa will be without leading players De Kock, Miller, Kagiso Rabada and Anrich Nortje as they head to the Indian Premier League.