Visakhapatnam: Dean Elgar and Quinton de Kock centuries helped South Africa fight back on Friday as the tourists reached 385 for eight in response to India's mammoth first-innings 502.
De Kock, a wicketkeeper-batsman, made 111 and put on a key 164-run stand with Elgar, who scored 160, to thwart the Indian bowling attack on day three of the first Test in Visakhapatnam.
Champion off-spinner Ravichandran Ashwin though kept chipping away to claim his 27th five-wicket haul and first since August 2017 in 66 Tests.
At stumps, the Proteas still trail by 117 runs as they chase India's first innings score of 502 for seven declared.
Debutant Senuran Muthusamy, on 12, and Keshav Maharaj, on three, were at the crease at stumps as 98 overs were bowled in the day to make up for lost time due to thunderstorms on day one.
De Kock completed his fifth Test hundred in the final session with a six off Ashwin before eventually being bowled by the off-spinner.
Ashwin, who rattled the South African top-order with his twin strikes on day two, struck again with the wicket of Vernon Philander for nought.
The left-handed Elgar, who started the day on 27, led his team's revival after they slipped to 63 for four in the morning session.
Elgar put on 115 runs with skipper Faf du Plessis for the fifth wicket to take the attack to the opposition bowlers with some positive batting.
Ashwin's spin partner Ravindra Jadeja also made it count with Elgar's wicket in the final session as he moved to 200 Test scalps.
South Africa started the day on 39-3 but fast bowler Ishant Sharma struck early, taking overnight batsman Temba Bavuma low for 18.
Jadeja also posed problems and nearly got Elgar on 74 but wicketkeeper Wriddhiman Saha spilled the chance.
Indian opener Mayank Agarwal set the tone for the hosts' dominance of the game with his 215 and a 317-run opening stand with Rohit Sharma, who hit 176 of India's giant score.
An over-enthusiastic fan caused a brief security scare in the afternoon session as he rushed on the field to get a selfie with the India captain Virat Kohli.
Kohli, who is treated as a national hero, was taken by surprise by the intrusion in between overs when the youth tried to hug him before taking a picture and touching the star player's feet.
Kohli tried to order the teenager off and vice-captain Ajinkya Rahane also intervened but the persistent fan stayed on the field for more than two minutes.
Security officers eventually overpowered him as he ran off, while the crowd roared and clapped.