Pakistan 177 (Sarfraz 56, Olivier 4-48, Steyn 3-48) and 294 (Shafiq 88, Babar 72, Masood 61, Rabada 4-61, Steyn 4-85) lead South Africa 431 (du Plessis 103, Bavuma 75, de Kock 59, Amir 4-88, Afridi 4-123) by 40 runs
Cape Town: South Africa will need to knock off just 41 runs on Sunday to beat Pakistan in the second test and take a winning 2-0 lead in the three-test series despite Pakistan providing gallant resistance on the third day at Newlands.
Shan Masood, Asad Shafiq and Babar Azam all scored half centuries on Saturday as Pakistan produced their best day of batting in the series but were eventually out for 294, setting their hosts a modest target to win.
They battled back to redesign South Africa's 254-run first innings lead however in the end capitulated as Dale Steyn and Kagiso Rabada both guaranteed four-wicket pulls.
Asad scored 88 runs, Babar 72 and Masood 61 to enable Pakistan to take a few positives from the amusement subsequent to neglecting to move beyond 200 keeps running in their past innings.
Masood had been advanced up the request in an offer to shore up a fragile batting lineup yet observed his initial two accomplices withdraw inexpensively as Pakistan lost Imam-ul-Haq and Azhar Ali, who both scored six runs each, and scored just 27 keeps running before lunch.
Home any desires for rattling through whatever remains of the batsmen after lunch were frustrated as Asad demonstrated forceful and Babar went up against the home bowlers.
Mohammad Amir took three wickets in an exuberant begin to Saturday's play as South Africa continued on 382-6 and included 49 additional keeps running before being rocked the bowling alley out.
He evacuated Quinton de Kock for 59 and after that took the wickets of Vernon Philander and Rabada for figures of 4-88.
South Africa won the main test in Pretoria a week ago by six wickets inside three days however should return the morning to complete off another success.