Slow left-armer Keshav Maharaj, playing his first match of the series, led the way with an outstanding performance, taking three for 45 – the first three wickets to fall – in 10 overs of teasing accuracy and flight.
But on a slow, dry pitch, he was well-supported by part-timers Aiden Markram, who bowled a full 10-over ration for the first time in his ODI career, and took two for 48 with his off-spin, and Jon-Jon Smuts who was also tidy with his left-arm orthodox, bowling his first seven overs for 42 runs before Hasan Ali hit him for four sixes in the penultimate over of the innings.
Both teams will feel they wasted an opportunity to take the upper hand though as Andile Phehlukwayo conceded 18 runs in the final over, Pakistan scoring a match-changing 43 runs in the last two overs.
Pakistan will, however, feel they wasted a chance to bat South Africa completely out of the game after another commanding century from Fakhar Zaman.
Fakhar went to 101 off 104 balls in measured, controlled fashion, and looked set to unleash another painful battering on the Proteas bowlers. But Maharaj had him caught behind attempting a delicate paddle shot, adding to his earlier dismissal of Imam-ul-Haq for 57, caught at long-on to end an opening stand of 112.
Pakistan captain Babar Azam remained calm as wickets tumbled at the other end, finishing strongly with a classy 94 off 82 balls. He was caught on the cover-point boundary off the last ball of the innings, having lifted their total to something substantial, along with Hasan, who destroyed the death bowling with 32 not out off just 11 deliveries.