Imam-ul-Haq and Mohammad Hafeez set up a five-wicket win for Pakistan in the first one-day international against South Africa.
The left-handed Imam made a calculated 86 off 101 balls and Hafeez struck an unbeaten 71 off 63 as Pakistan chased down 267 with five balls to spare.
Hashim Amla's 27th ODI hundred was not enough for South Africa, who lost only two wickets in scoring 266 runs after opting to bat first.
Pakistan bowlers deserved credit for their team's win, which came after the tourists were mauled 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.
Strike bowlers Kagiso Rabada and Duanne Olivier conceded a combined 124 runs in 19.1 overs.
Amla (108*) and Hendrick ‘Rassie’ van der Dussen (93) put on 155 for South Africa's second as they gradually increased the tempo of their partnership but 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."
Player 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 by Imam and Fakhar Zaman had given Pakistan the much needed momentum which was then further continued during the partnership between Imam and Azam.
Seamer Hasan Ali and leg-spinner Shadab Khan Pakistan’s best bowlers and the only two who bowled their full quota of ten overs, took one for 42 and one for 41 respectively.
Pakistan were 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.