Captain Faf du Plessis led from the front with a hard-earned century to give South Africa a commanding 205-run advantage at the end of the second day of the second Test against Pakistan, at Newlands, on Friday.
Du Plessis failed to score in either innings in the first Test in Pretoria last week, but made 103 in a 226-ball knock as South Africa piled up 382 for six in reply to Pakistan's 177 all out on the opening day.
Pakistan will be up against it on Saturday when South Africa resume with Quinton de Kock not out on 55 and Vernon Philander on six as they look to press home their advantage.
Du Plessis had to toil for his ninth Test century on an uneven pitch, hitting some superb shots through extra cover but also surviving being dropped on 96 to an easy catch down leg that Pakistan wicketkeeper Sarfraz Ahmed spilt.
He was eventually out to a feint tickle off teenager Shaheen Shah, who finished the day with the best Pakistan figures of 3-112.
Temba Bavuma, who saw two reviews go his way, made 75 and it was his 156-run fifth wicket partnership with the skipper that enabled South Africa to take the game away from their opponents after losing two wickets early in the day.
South Africa were on 123-2 overnight but Hashim Amla (24) and Theunis de Bruyn (13) departed in the morning session before Bavuma, having scored three, was reprieved by the third umpire after appearing to be caught in the slips.
It was decided that the catch had been taken off the turf.
He also survived a lbw decision with the review going his way to the exasperation of Pakistan.
Bavuma was eventually caught by Sarfraz off Shaheen, who then also bagged du Plessis but only after another review, which this time went Pakistan's way.
De Kock hit fours off his first two deliveries and never looked back as he raced to his half century off 59 balls.