Spin bowler Yasir Shah took four wickets for Pakistan in South Africa's second innings. Picture: Getty Images
Left-arm spinner Nauman Ali took 5-35 for the hosts while Yasir Shah finished with 4-79.
Temba Bavuma was the last man out for 40.
Earlier, the Proteas had resumed their second innings on 187 for 4, holding a lead of 29 runs.
The second Test starts on February 4 in Rawalpindi.
For more news your way, download The Citizen’s app for iOS and Android.
Download our app