Pakistan managed to secure a consolation victory on Wednesday in the third Twenty20 international against South Africa at SuperSport Park.
The green shirts defeated South Africa by 27 runs, thereby denying them the chance of clean sweeping the series.
South Africa were given a target of 169 against which they only managed to score 141.
Mohammad Amir took three wickets whereas Shadab Khan and Faheem Ashraf took two each.
In the first innings, left-arm opening bowler Beuran Hendricks took a career-best four for 14 as South Africa restricted Pakistan to 168 for nine.
Seven Pakistan batsmen reached double figures but the highest score was 26 by Mohammad Rizwan.
Seeking a consolation win after losing the first two matches in the series, Pakistan made a fast start but were unable to put together any significant partnerships.
A mid-innings collapse when three wickets fell for five runs in nine balls reduced Pakistan to 94 for five, with Rizwan, captain Shoaib Malik and Hussain Talat falling in quick succession. Malik was run out for 18 after a mix-up with Talat.
Shadab Khan hit three sixes in the final over from Andile Phehlukwayo to finish with 22 not out off eight balls. The last over cost 21 runs.
Babar Azam again gave Pakistan a good start, striking 23 off 11 balls before he was caught at cover off Chris Morris in the third over. Morris finished with two for 27.
South Africa: 1 Reeza Hendricks, 2 Janneman Malan, 3 Rassie van der Dussen, 4 David Miller (capt), 5 Heinrich Klaasen (wk), 6 Chris Morris, 7 Andile Phehlukwayo, 8 Junior Dala, 9 Lutho Sipamla, 10 Beuran Hendricks, 11 Tabraiz Shamsi
Pakistan: 1 Babar Azam, 2 Fakhar Zaman, 3 Hussain Talat, 4 Asif Ali, 5 Shoaib Malik (capt), 6 Mohammad Rizwan (wk), 7 Imad Wasim, 8 Shadab Khan, 9 Faheem Ashraf, 10 Mohammad Amir, 11 Shaheen Shah Afridi