Newlands, January4: Faf du Plessis compiled a battling hundred and Temba Bavuma capitalised on a controversial early let-off to add 75 as South Africa strengthened their hold on the second Test with Pakistan in Cape Town.
Having resumed on 123 for two in reply to Pakistan's paltry first-innings total of 177, the Proteas opened up a lead of 205 by reaching 382 for six, with Du Plessis defying two painful blows on the top hand to contribute 103.
South Africa's captain shared 156 for the fifth wicket with Bavuma, but Pakistan felt they had dismissed the latter for three when an edge off Mohammad Abbas was claimed by Azhar Ali at first slip.
However, after viewing television replays, the third umpire determined the ball had not been taken cleanly, meaning Bavuma was able to pile on the runs alongside his skipper.
Quinton de Kock also made hay with 55 not out from 72 balls late on day two as South Africa - already 1-0 up in the three-Test series - opened up a huge lead on a wicket featuring plenty of cracks.
Fit-again seamer Abbas certainly had assistance from the surface when he dismissed Hashim Amla (24) in the second over of the morning session, the Proteas number three bowled round his legs by one that jagged in sharply off the seam.
Theunis de Bruyn soon followed - caught in the gully off Shaheen Afridi for 13 - but Bavuma's subsequent escape, almost identical to the overturned dismissal of Dean Elgar in Centurion that angered Pakistan coach Mickey Arthur, proved key as South Africa regained control. The diminutive batsman also survived an lbw review on three before gradually finding his feet.
There was further frustration for Pakistan as Bavuma successfully reviewed an lbw decision on 65 when HawkEye showed an Abbas delivery would have cleared the stumps by the narrowest of margins, while Du Plessis was dropped by opposite number Sarfraz Ahmed on 96 - the ball deflecting into the wicketkeeper's face via his gloves.
Having battled hard on a challenging pitch, both Bavuma and Du Plessis were eventually caught behind off Shaheen, but the dismissal of the former merely brought in De Kock, who scored freely from the outset.
A miserable day for Pakistan was summed up in the final over as they wasted their second review in the belief De Kock had got a thin edge on to his pad off Yasir Shah before Sarfraz completed a catch.