Pakistan captain Misbah-ul-Haq led his side to a three-wicket win over South Africa in the fourth one-dayer on Thursday, setting up a series decider in the final match in Benoni on Sunday.
Misbah made 80 and Imran Farhat scored 93 as Pakistan chased down South Africa's total of 234 for nine with eight balls to spare.
Misbah and opening batsman Farhat shared a 153-run fourth wicket partnership after Pakistan had been struggling at 33 for three after 11 overs.
The early wickets included that of Mohammad Hafeez, who was given out for obstructing the field in the second over.
He changed direction and was hit on the leg by a throw from South African wicketkeeper and captain AB de Villiers, who was throwing at the stumps at the bowler's end when Hafeez was several metres out of his ground.
Hafeez was only the fourth batsmen - and the third Pakistani - to be dismissed for obstructing the field in one-day internationals.
Pakistan's fast bowlers struck early and off-spinner Saeed Ajmal took three crucial middle order wickets as South Africa struggled after winning the toss, despite a fourth wicket stand of 115 between captain De Villiers (75) and David Miller (67).
South Africa's troubles started early when the tall left-armer Mohammad Irfan took wickets with the first two balls of the match.
He had Hashim Amla caught behind, then bowled Colin Ingram with a yorker.
Fellow left-armer Junaid Khan followed up with the wickets of Graeme Smith and Farhaan Behardien as South Africa slumped to 38 for four after winning the toss.
De Villiers and Miller gave the home side hope of making a good total before Miller missed a sweep against Ajmal and was out after a career-best innings. Miller's 67 was scored off 77 balls and he hit seven fours.
Miller's dismissal came nine balls before the batting power play and South Africa's hopes plummeted when De Villiers was caught behind when he was adjudged to have gloved a sweep against Ajmal.
The off-spinner had Ryan McLaren caught in the deep as the power play yielded just 17 runs for the loss of two wickets.
Ajmal took three for 42 in ten overs, while Irfan claimed three for 46 in nine and Junaid took three for 45 in nine.
Misbah and Farhat started their stand slowly, with the fifty partnership taking 82 balls, but they picked up the pace, helped by the introduction into the South African attack of part-time leg-spinner Ingram, whose first over in international cricket cost 17 runs, including two sixes and a four by Misbah.
They had been together for 187 balls when Misbah, who has yet to hit a century in 113 innings, holed out to deep midwicket when 49 runs were still required.