Virat Kohli kept India alive in the second Test with a masterful hundred before AB de Villiers turned the tide in South Africa's favour on an eventful third day, affected by rain and bad light.
De Villiers scored his 42nd half-century as South Africa reached 90 for two at stumps in their second innings, overcoming a disastrous start to lead India by 118 runs.
Only 10 overs were possible in the final session as rain and bad light hampered play.
At the close, de Villiers was unbeaten on 50 runs (78 balls, 6 fours) while Dean Elgar was batting on 36 not out (78 balls, 4 fours). They added 87 runs for the third wicket, with South Africa’s overall lead at 118 runs.
Post tea, play was possible for 20 minutes before a thunderstorm washed away nearly an hour.
At resumption of play, the Indian skipper was clearly unhappy with the wet ground and how it affected the ball as well. No overs were lost though, and, when play resumed, the session had been extended an hour past local time to end at 6.30pm local time. However, only 5.1 overs were possible on resumption as the umpires stopped play for bad light.
A lot happened in that passage of play though. Parthiv Patel missed a simple chance from Elgar (on 29) who edged behind off Jasprit Bumrah (2-30) in the 25th over.
The wicketkeeper kept watching as the ball sailed in the gap and away for four, expecting Cheteshwar Pujara at first slip to go for it.
De Villiers then reached his half-century off 78 balls, just before the second stoppage in this session. The umpires waited nearly 66 minutes before calling off play due to poor light.
Earlier, Bumrah reduced South Africa to 60 for two at tea, bowling a wonderful spell with the new ball even as the SupersportPark pitch started keeping low.
He accounted for both Aiden Markram (1) and Hashim Amla (1) in the space of three overs as South Africa were reduced to three for two in the 6th over.
Ravichandran Ashwin (0-33) had opened the bowling while Ishant Sharma (0-14) came in as first change.
This was after Virat Kohli scored 153 runs (217 balls, 15 fours) to guide India’s first innings. Post lunch, he tried to shield Ishant Sharma (3) and their partnership for the ninth wicket lasted nearly nine overs during which they put up 25 runs.
But Morne Morkel (4-60) accounted for Ishant off a short ball in the 91st over and then two overs later Kohli was last man out, caught at long on.
Before lunch, Kohli struck his 21st hundred as India reached 287 for eight.
Starting at an overnight score of 183 for five, he and Hardik Pandya (15) took their overnight sixth wicket partnership to 45 runs. In doing so, they helped India cross 200 in the 65th over.
Kohli then reached his hundred off 146 balls, inclusive of 10 fours. He became the first overseas captain to score a Test hundred at Centurion. The previous highest score by a visiting captain at this ground was 90 by MS Dhoni in 2010.
Additionally, he became only the second Indian skipper to score a Test hundred on South African soil, after Sachin Tendulkar at Cape Town in 1997.
This was Kohli’s second Test hundred in South Africa, the second-most after Tendulkar who has five Test hundreds here.
However, Kohli’s joy was cut short as another suicidal moment of running between the wickets gifted South Africa a breakthrough, as Pandya was run-out for not dragging his bat in.
He had set off for a run in the 68th over, only for Kohli to send him back but Vernon Philander’s throw from mid-on beat him by inches as Pandya didn’t drag his bat or even grounded his foot.
Kagiso Rabada (1-74) then bowled a testing spell to Ashwin (38, 54 balls, 7 fours), but the batsman managed to survive a barrage of short balls, despite being hit on his left hand. He countered by taking three boundaries off Rabada in his next over.
The duo continued to score at a good pace and brought up their 50-stand off 62 balls.
South Africa took the second new ball in the 82nd over, and Philander immediately struck. Ashwin was caught at second slip off his third delivery. He put on vital 71 runs with Kohli for the seventh wicket.
In the very next over, Morkel had Mohammed Shami (1) caught at first slip as Kohli began to run out of partners.
PHOTOS: Kohli shines, but South Africa on top
Fans swoon as sleeveless Nadal turns up the heat in Melbourne!
England's Ben Stokes charged with affray
Day 2 at Aus Open: Federer, Djokovic in action on day of returns
Why lukewarm reception would not faze Sharapova