Mayank Agarwal converted his first Test hundred into a double century as India dominated South Africa on day two of the first Test at Visakhapatnam.
Agarwal hit 215 and added 317 for the first wicket alongside Rohit Sharma (176) as India amassed 502 for seven declared.
The Proteas, starting their World Test Championship campaign, slipped to 39 for three in reply - still 463 in arrears - as Ravichandran Ashwin struck twice.
The hosts had earlier resumed on 202 without loss. Sharma, opening for the first time in Test cricket, was one run shy of his highest score in the format when he was stumped by Quinton de Kock off Keshav Maharaj.
Agarwal's maiden Test century included 13 fours and two sixes, but he lost partners at regular intervals after lunch.
Cheteshwar Pujara (six) was bowled by Vernon Philanderer, captain Virat Kohli was caught and bowled by Senuran Muthusamy for 20, and Ajinkya Rahane fell to Maharaj for 15.
Agarwal eventually departed when he cued Dean Elgar's part-time spin to deep mid-wicket, having faced 371 deliveries, with 23 fours and six sixes.
Ravindra Jadeja, meanwhile, finished unbeaten on 30 when the declaration came after 136 overs.
India's bowling attack then enjoyed some early success in the closing session, with Aiden Markram (five) bowled by Ashwin, Theunis de Bruyn (four) caught behind off the same bowler and nightwatchman Dane Piedt castled for a duck by Jadeja.
Elgar will resume on Friday on 27 not out, with Temba Bavuma unbeaten on two.