De Kock slammed 83 off 58 balls as South Africa chased down a target of 241 with seven wickets and 10 overs to spare to seal a 3-2 series win.
While man-of-the-match De Kock sealed the win with his dazzling strokeplay, South Africa’s bowlers played a significant role by restricting Pakistan to 240 for eight despite an aggressive 70 by Fakhar Zaman.
While Zaman was at the crease, Pakistan were on course for a big total. He was fourth out after a 73-ball innings when the total was 128 in the 25th over. But the scoring rate slowed after his dismissal, with only 49 runs scored in the next 15 overs.
Pakistan stand-in captain Shoaib Malik congratulated opening batsman Imam-ul-Haq, who was named man of the series after scoring 271 runs at an average of 54.20 in five innings. “He is improving day by day,” said Malik.
Imad Wasim, batting at number eight, gave the innings late impetus, hitting 47 not out off 31 balls. He struck sixes off Dale Steyn and Kagiso Rabada in the last two overs.
Medium-paced all-rounders Dwaine Pretorius and Phehlukwayo both took two wickets in a disciplined South African bowling performance.
The left-handed Zaman hit ten fours in making his first half-century after a sequence of low scores in both the Tests and the ODIs.
He was dropped on 20 when he slashed Rabada to Hashim Amla, who could not hold a sharp, chest-high chance.
Fellow left-hander De Kock went for his shots from the start of South Africa’s innings and had a let-off in the third over with his score on 12 when a mis-hit against Usman Shinwari looped to cover.
But after asking for a replay, umpire Gregory Brathwaite no-balled Shinwari for overstepping.
De Kock went on to hit 11 fours and three sixes before he was again caught off Shinwari, this time off a legal delivery, with substitute Hasan Ali taking a good running catch at deep midwicket.
With the required rate reduced to less than three an over, Du Plessis and Rassie van der Dussen were untroubled in an unbeaten fourth-wicket partnership of 95, with both batsmen hitting half-centuries. Van der Dussen finished the match by hitting a straight six off leg-spinner Shadab Khan.
All five matches in the series were won by the side batting second.