Jacques Kallis scored an emotional century in his final Test match as South Africa gave themselves an outside chance of winning the second Test in Durban.
The 38-year-old, playing in his 166th and final Test match, scored 115 as the Proteas made 500 at Kingsmead, a first innings lead of 166.
India lost Murali Vijay and Shikhar Dhawan in their reply as the tourists finished Day 4 on 68-2, a deficit of 98.
|India 2nd Innings: 68-2 (36 Overs)|
|S Dhawan||c du Plessis b Peterson||19||120||87|
|M Vijay||c Smith b Philander||6||23||13|
|CA Pujara||not out||32||90|
|V Kohli||not out||11||26|
Kallis resumed Day 4 on 78 and recorded his 45th Test ton with a single off Ravindra Jadeja to great acclaim from all in attendance.
South Africa had added 85 to their overnight total of 299-5 when Kallis departed for 115, caught behind off Jadeja, a fifth wicket for the left-arm spinner.
Kallis saluted the crowd and given the match situation, he looks likely to end his career with 13,289 runs at an average of 55.37—the highest average of the seven men in Test history to have scored over 11,000 runs.
Dale Steyn followed soon after for 44, caught behind off Zaheer Khan and the hosts held a slender lead of 53 on first innings with three wickets intact.
However an eighth-wicket partnership of 110 between Faf du Plessis and Robin Peterson, who blasted nine fours and a six in a 52-ball 61, gave them a sizeable first innings advantage.
Peterson was caught at mid-off, attempting another big hit off Zaheer, before du Plessis was run out for 43 and Morne Morkel was dismissed for a second-ball duck.
|South Africa 1st innings: 500 (155.2 Overs)|
|JH Kallis||c †Dhoni b Jadeja||115||393||316|
|DW Steyn||c †Dhoni b Khan||44||139||94|
|F du Plessis||run out (RG Sharma)||43||105||70|
|RJ Peterson||c Vijay b Khan||61||88||52|
|VD Philander||not out||0||6||3|
|M Morkel||c & b Jadeja||0||2||2|
|Extras||(b 3, lb 15, w 2, nb 3)||23|
In their reply, India quickly lost Vijay for six as he was caught at first slip by Graeme Smith off Vernon Philander.
Dhawan departed for 19 after a stunning leaping catch by du Plessis at mid-wicket off Peterson.
Cheteshwar Pujara (32) and Virat Kohli (11) are the unbeaten batsmen with India needing to bat for at least two sessions on Monday's final day to ensure the two-match series ends level at 0-0.