Imam-ul-Haq and Mohammad Hafeez set up a five-wicket win for Pakistan in the first one-day international against South Africa at St George's Park on Saturday.
The left-handed Imam made a cultured 86 off 101 balls and Hafeez hit an unbeaten 71 off 63 deliveries as Pakistan chased down a target of 267 with five balls to spare.
Hashim Amla's 27th one-day international century was not enough for South Africa, who lost only two wickets in scoring 266 runs after winning the toss.
Pakistan's bowlers deserved credit for their team's win, which came after the tourists were well-beaten in all three Test matches.
Pakistan captain Sarfraz Ahmed used his bowlers in short spells and their mixture of seam and spin proved better suited to a slow pitch than South Africa's attack.
South African strike bowlers Kagiso Rabada and Duanne Olivier conceded a combined 124 runs in 19.1 overs.
The Pakistan batsmen also proved better at rotating the strike, particularly during a 94-run second-wicket stand between Imam and Babar Azam (49).
Amla (108 not out) and new cap Hendrick ‘Rassie’ van der Dussen (93) put on 155 for South Africa's second wicket but although they gradually increased the tempo of their partnership they were unable to dominate the bowling.
"Those two guys batted really well but there were probably 15 or 20 more runs that we could have scored if we had pushed a bit harder," said South African captain Faf du Plessis.
"Pakistan bowled really well in the middle overs."
Man of the match Hafeez said: "We were confident because we knew 266 was not a par score on this track. The first win of the series is very important."
Hafeez said an aggressive opening stand of 45 off 50 balls by Imam and Fakhar Zaman had given Pakistan momentum which was continued during the partnership between Imam and Azam.
Seamer Hasan Ali and leg-spinner Shadab Khan were the best Pakistan bowlers and the only two who bowled their full quota of ten overs, taking one for 42 and one for 41 respectively.
Pakistan looked to be cruising to an easy win until Imam was dismissed in the 37th over when he stepped out of his crease and sliced an attempted drive to deep cover.
Two more wickets fell cheaply before Hafeez and Shadab saw their side home, maintaining an unbeaten record for Pakistan in five one-day matches in Port Elizabeth, four of them against South Africa.
Amla and Reeza Hendricks (45) put on 82 off 105 balls for the first wicket before Van der Dussen made a slow start in his first one-day international, taking ten balls to score his first run.
Van der Dussen gained confidence as he hit six fours and three sixes in a 101-ball innings before hitting a full toss from Hasan to long-off in the 47th over. Amla made his runs off 120 balls with seven fours and a six.