Pakistan batting line suffered another collapse as they tumbled from 101/1 to 190/10, while Shan Masood played a resilient knock of 65 runs.
Pakistan were trailing by 42 runs in the first inning, after losing Fakhar Zaman on 44, Imam Ul Haq and Shan Masood had a convincing partnership of 57 runs, before the former fell after scoring 57 runs.
Afterwards, it was a vulnerable display of batting by the visitors, Shan Masood kept playing impressive strokes from one end while losing his partners from the other end.
Azhar Ali and Sarfraz Ahmed failed to open their accounts, whereas Asad Shafiq and Babar Azam scored 6 runs apiece.
Mohammad Amir looked to keep South African bowlers out, but he failed after scoring 12 runs, the leg-spinner Yasir Shah got out after scoring a duck.
Masood had a handy 26-run partnership with Hasan Ali, but in a strive to keep the pacer away from strike and score runs on his own, he played a lofty shot off Dale Steyn, which was caught by Keshav Maharaj in the deep. He scored 65 runs.
Shaheen Shah fell after scoring four runs, while Hasan Ali remained not out on 11. As Pakistan got all out for 190, it set a fairly low target for South Africa of 149 runs.
Duanne Olivier once again remained the pick of the bowler for the Proteas with his second five-wicket haul of the match, while the top-ranked Test bowler, Kagiso Rabada picked 3 wickets and Steyn hunted two batsmen.
South Africa will start off their chase on the third day of the Test, Pakistan’s bowling line has got the firepower to restrict the hosts below 148, it will be an exciting contest between the two sides.