South Africa will have to reach a mammoth second-innings total of 458 runs if they are to secure victory over India in the first Test in Johannesburg.
India began the day firmly in control on 284-2 and the partnership of Cheteshwar Pujara and Virat Kohli passed the 200-mark.
The tourists added another 31 runs before Cheteshwar Pujara's innings of 153 off 270 was brought to an end, as the prolific batsman edged Jacques Kallis to AB de Villiers.
Rohit Sharma was dismissed for six before the vital wicket of Kohli (96) fell when he clipped JP Duminy to de Villiers.
In the last over before lunch, Duminy took the wicket of Ajinkya Rahane and MS Dhoni (29) was dismissed early in the afternoon session.
Only Zaheer Khan (29) offered a significant amount of tail end resistance as South Africa kept their slim hopes of victory intact by dismissing the tourists for 421.
The hosts reached tea at 30 without loss, but the 108-run opening stand came to an end when Graeme Smith was run out by a fantastic piece of fielding by Rahane.
Hashim Amla soon followed his captain into the pavilion in bizarre fashion, as he ducked under Mohammed Shami's slow ball, only to see it topple his off stump.
Alviro Petersen (76) and Francois du Plessis (10) ended the day unbeaten as the hosts clung onto the slim possibility of wrestling the first Test from the grasp of India.