At the break, Faf du Plessis was batting on 12 not out while Vernon Philander was giving him company on three not out.
This was after news broke that Virat Kohi has been fined 25 per cent of his match fees and received one demerit point for breaching Level 1 of the ICC Code of Conduct during the final session on day three.
The Indian skipper had protested animatedly to on-field umpires Paul Reiffel and Michael Gough that the ball was too wet when play resumed after a brief rain break. He later pleaded guilty to the charge.
Jasprit Bumrah (2-47) and Ishant Sharma (0-29) started proceedings for India.
While Bumrah attacked the batsmen more, Ishant was content on keeping the run-rate down. It allowed an easy first hour for the batting pair as they added 54 runs until drinks.
Their 100-stand came off 167 balls. South Africa crossed 100 in the 33rd over and then 150 in the 43rd.
The turn-around came when Shami (3-38) was introduced into the attack and he immediately started getting the ball to reverse.
Four overs later, Elgar pulled a short ball off Shami straight to KL Rahul at deep square leg. The fielder fumbled but managed to hold on.
In the 47th over, Rahul fumbled again at backward short leg off R Ashwin (0-57) and this time dropped du Plessis (on 6). It was a tough chance but he managed to get a full hand to it on diving to his right.
In the very next over, Parthiv Patel misjudged another chance as Shami induced an edge off Quinton de Kock (12), with the keeper moving in the opposite direction to the ball.
South Africa had lost three wickets for 19 runs in the space of 39 balls and were reduced to 163 for five.
Du Plessis and Philander stemmed the mini-collapse even as the lead crossed 200 in the 52nd over.
On day one, South Africa won the toss and chose to bat with the pitch surprising everyone with its flat nature. Aiden Markram top-scored with 94 as Ashwin took 4-113.
On day two, India finished with 183/5 at stumps. On day three, Virat Kohli went on to score 153, his 21st Test hundred as the visitors were bowled out for 307, conceding a 28-run first innings lead. Morne Morkel took 4-60.
Disclaimer: No Business Standard Journalist was involved in creation of this content
