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 day two of the second Test against Pakistan at Cape Town.

Du Plessis made a pair in the first Test last week, but scored 103 in a 226-ball knock at Newlands as South Africa piled up 6-382 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.

It was a frustrating day for the tourists, who had another close catch go against them at a pivotal moment in the opening session.

South Africa were 2-123 overnight but Hashim Amla (24) and Theunis de Bruyn (13) departed early before Temba Bavuma, having scored three, appeared to be caught by Azhar Ali low down at slip to leave the Proteas in trouble at 5-156.

Despite umpire Bruce Oxenford giving a 'soft signal' of out, third umpire S Ravi ruled the ball had touched the turf and Bavuma was reprieved.

It was an identical situation to a controversial not out decision in the first Test, when Azhar was denied a catch at first slip by the third official despite the on-field umpire giving a soft signal of out.

Pakistan coach Mickey Arthur received an official warning and a demerit point for his reaction to that incident in Centurion, but despite him again showing his disappointment on Friday, the South African coach wasn't too fazed with the decision.

“It was actually quite easy (to keep my cool) because I got a demerit point last week,” the affable Arthur said with a smile after play.

“So I made sure (strength and conditioning coach) Grant Luden held me back. I said ‘just hold me now’ and he did.

"But to be fair, I wasn’t quite sure that he caught it either. So it was a little bit different to last week.”

Bavuma went on to make 75 and it was his 156-run fifth wicket partnership with du Plessis that enabled South Africa to take the game away from their opponents.

He also survived a lbw decision later in his innings, with the review going his way to the exasperation of Pakistan.

Bavuma was eventually caught by Sarfraz Ahmed off Shaheen Afridi (3-112), who then also bagged du Plessis but only after another review, which this time went Pakistan's way.

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 Sarfraz spilt.

De Kock hit fours off his first two deliveries and never looked back as he raced to his half century off 59 balls.