Tailenders Vernon Philander and Keshav Maharaj staged a late rally, but it was India who took control of the third Test against South Africa in Pune.
Resuming on 36 for three in reply to the home side's 601 for five declared, the Proteas slipped to 162 for eight before the pair came together.
Maharaj went on to score a career-best 72 from 132 deliveries and Philander struck an unbeaten 44, with the pair adding 109 for the ninth wicket as the tourists were dismissed for 275.
Ravichandran Ashwin finished with four for 69 to give India a lead of 326 and it remains to be seen if they will enforce the follow-on.