Dean Elgar described his dismissal to Dom Bess as a "brainfart" after South Africa collapsed on day two of the second Test against England at Newlands. 

The opener and Rassie van der Dussen put on 117 for the fourth wicket after the Proteas slumped to 40-3 in reply to the tourists' 269 all out, but Elgar threw his wicket away with a century in sight.

Left-hander Elgar appeared to lose his patience on 88 with a big swing at spinner Bess and was caught by England captain Joe Root at mid-off.

England fought back superbly in the final session, James Anderson taking 3-34 as South Africa were reduced to 215-8 - trailing by 5 runs at the close on Saturday.

"It was [about] trying to be as patient as possible," Elgar told a news conference of his approach alongside Van der Dussen, who made 68. "If he overpitches it, try to hit the ball to long-on. It was pretty much as easy as that.

"I felt I played him very well until the brainfart - and then I was sat in the changing room. That's all it is.

"[It was] a big one. I don't think it was anything to do with the patience factor. I might have just chosen the wrong ball to do what I wanted to do.

"A few overs ago, I hit him for four. It's a great shot, isn't it? And now you choose the wrong ball, and that's pretty much all she wrote."

Elgar was apologetic for his dismissal, adding: "It's actually not right of me playing shots like that, especially being a senior batter. I shouldn't be putting other guys under pressure like that.

"But I'm also a human being - I'm allowed to make mistakes. I've got two arms, two legs and another thing, so I'm allowed to."

Elgar acknowledged England are now on top, with Keshav Maharaj dismissed with what proved to be the final ball of the day from Anderson..

"I would say, after the last hour, they've potentially got one foot ahead of us," Elgar said. "It's difficult to look into the future of this game.

"We know we've got a good battle coming up tomorrow with the ball in hand."