Pakistan had a few nervy moments but ultimately had enough to defeat South Africa and complete a 2-1 T20 series win in Lahore.
The T20I series between Pakistan and South Africa will go down to a final game after the Proteas won the second match in Lahore.
An unbeaten 104 from Mohammad Rizwan helped Pakistan record a narrow victory in the first of three Twenty20 games in Lahore.
Heinrich Klaasen captains an inexperienced South Africa squad in the three-match T20 series against in-form Pakistan.
Pakistan secured a 2-0 win over South Africa after Aiden Markram's hundred had put the Proteas in a promising position.
Mohammad Rizwan left South Africa needing a record chase in Pakistan to square the series, though their reply started well.
Keshav Maharaj and George Linde took five wickets between them but Pakistan's lead reached 200 at stumps on day three in Rawalpindi.
Anrich Nortje took the third five-wicket haul of his Test career, but South Africa ended day two on the back foot again against Pakistan.
Pakistan lost three wickets for one run in the first session against South Africa but Babar Azam and Fawad Alam stopped the rot.
Pakistan triumphed in Karachi in the first Test as the Proteas saw their winless run continue, despite a valiant fightback.