Gautam Gambhir and Sachin Tendulkar led India's strong reply with the bat after Jacques Kallis's 39th Test century lifted South Africa to 362 on Day 2 of the third and final Test at Newlands in Cape Town, on Monday.
At stumps, India were 142 for two in 50 overs in their first innings, still trailing the hosts by 220 runs.
Gautam Gambhir, who was dropped twice (on 10 and 60), blossomed after a nervous start to reach 65 from 159 balls, with the help of eight fours, while Sachin Tendulkar was on 49 from 106 balls (5 fours). The duo put on 114 runs in 39.1 overs for the third wicket to steady the innings after they were reduced to 28 for two at one stage following the run-out of Rahul Dravid for five and exit of Virender Sehwag (13) early.
India scored just 35 runs in the last 20 overs of the final session without a single boundary.
Earlier, Kallis hit his second century of the series as he stroked 161 from 291 balls to take South Africa to a healthy 362 in their first innings. The veteran batsman was the final wicket to fall; he was caught behind off Zaheer Khan, who claimed three for 89 in 29.5 overs.
S Sreesanth shone with the ball for India, claiming five for 114 in 29 overs, to trigger a lower order collapse, but Kallis frustrated the Indians as he added 52 runs for the final wicket with Lonwabo Tsotsobe (8).
Kallis, with 39 centuries, joined Ricky Ponting in second place in the list of most century scorers in Test cricket, which is led by Sachin Tendulkar, with 50 centuries.
On Sunday, Kallis and Hashim Amla hit half-centuries to take their team to 232 for four in 74 overs after they were sent into bat on a rain-hit first day when 16 overs were lost because of rain and bad light.
The three-match series is locked 1-1.
Morning session: (103 runs, 30 overs, 5 wickets)
As expected, India did most of the damage with the second new ball, Sreesanth showing the way.
Prince started confidently, hitting Harbhajan for two delightful boundaries through the covers in the third over of the day. Kallis also continued his good form, driving Ishant through mid-off for his first boundary of the day.
India took the second new ball straightaway after 80 overs and it paid off as wickets kept tumbling at regular intervals.
Sreesanth started off with two wickets in his first over on day two. Prince was his first victim; he was beaten all ends up by a delivery that came in and sneaked through his defences. He was bowled for 47.
Sreesanth then produced another beauty to get rid of Mark Boucher (0), as he got the outswinger to pitch perfectly and take the outside edge.
In the next over, Kallis gave Sreesanth some rough treatment as he hit the pacer for back-to-back boundaries through the midwicket region to move to 99.
Zaheer then got the better of Steyn as he bowled a quick bouncer directed at his body which the batsman could only fend and was caught at gully for a duck.
Meanwhile, Kallis completed his century off 209 balls with a single on the leg side off Sreesanth in the 88th over. This was his 39th century in Tests, puting him in joint second place in the list of most centuries in Tests, which is headed by Sachin Tendulkar, ,who has 50.
Kallis continued his love affair with Newlands as he brought up his seventh century at the venue and his second of the series.
Morne Morkel was caught behind for eight, giving Sreesanth a five-wicket haul.
It was a dramatic turnaround as South Africa lost four wickets for 21 runs in the space of four overs, with Sreesanth taking three of them.
While wickets were falling at the other end, there was no stopping Kallis. The right-hander took full toll of two short deliveries from Ishant and crashed them for boundaries on either side of the wickets.
Kallis and Paul Harris were starting to frustrate the Indians as they started to stitch together a partnership and kept the scoreboard moving.
Ishant finally managed to breakthrough as he went round the wicket and got Harris caught at leg slip off a short delivery for seven.
Kallis was able to find the boundaries at will as he slammed Zaheer for another couple of fours to take the total to 322 for nine after 100 overs.
At lunch on day two, South Africa were 335 for nine in 104 overs as they continued to pile on the runs despite losing five wickets in the session.
Kallis showed his class, stroking 140 from 253 balls, having hit 15 fours, while Tsotsobe hung around and was not out on three.
India's pacers finally woke up and dealt crucial blows with the second new ball. Sreesanth took five for 99 in 27 overs to continue his good run in South Africa, while Zaheer (2 for 82) and Ishant (2 for 77) were the other wicket-takers.
Post-lunch session: (76 runs, 24.5 overs, 3 wickets)
India were frustrated as the South African last pair hung on for a while, with Kallis piling on the runs.
Kallis started the session in some style as he pulled a short delivery from Sreesanth through the square leg region for a four. In the pacer's next over, he punished him further as he hit back-to-back boundaries through the off-side to bring up his 150 from 269 balls.
Kallis was not only finding the boundaries at regular intervals but also managed to keep Tsotsobe off the strike as much as possible.
Tsotsobe continued to frustrate the Indian bowlers as he kept defending and gave Kallis good support. The duo brought on the 50-run partnership for the final wicket with Tsotsobe contributing eight from 27 balls and Kallis doing majority of the scoring with a flurry of boundaries.
India finally managed to get the big wicket of Kallis as the right-hander was caught behind trying to play the cut shot against Zaheer. Kallis was dismissed after a brilliant knock of 161, inclusive of 19 fours in 291 balls, during his 459-minute stay at the crease.
The last three wickets added 90 runs with Kallis showing the way, while Harris, Morkel and Tsotsobe hung around for 90 deliveries combined.
Sreesanth was the wrecker-in-chief as he took five for 114 in 29 overs, while Zaheer took three for 39 and Ishant claimed two for 77.
(India 1st innings)
Virender Sehwag got going in style, hitting Morne Morkel for a couple of boundaries in the second over. But South Africa managed to keep him in check with some good line and length bowling.
As expected, Sehwag could not be kept quiet for long and he slammed a short, wide delivery from Steyn through the covers for a four.
But the South African speedster had his revenge when he got the wicket of Sehwag off the very next delivery. Sehwag was brilliantly caught by Smith at mid-off as he looked to drive one through the off-side after scoring 13.
Rahul Dravid (4), playing in his 150th Test, would have fallen in the very next over as South Africa missed an easy run-out opportunity. Substitute JP Duminy missed the stumps at non-striker's end with Dravid halfway down the crease and Gambhir got a free boundary courtesy the overthrow.
The indecisiveness between the two while running finally cost India. Gambhir (10) was dropped at gully off Tsotsobe but the two batsmen still went for a quick single, resulting in Dravid (5) being run-out from a direct hit by some quick thinking from AB de Villiers at second slip after that drop.
Gambhir then played the upper cut against Steyn for a four, while his thick edge fetched him another boundary in that over.
Sachin Tendulkar bagged his first four when he flicked a full delivery from Steyn through midwicket in the final over of the session.
At tea, India were 49 for two in 16 overs, still trailing South Africa by 313 runs. Gambhir, who was dropped on 10, was unbeaten on 22 from 45 balls, while Tendulkar made eight.
While the pitch looked better for batting than on day one, South Africa kept chipping away at the wickets to check India's progress.
Post-tea session: (93 runs, 34 overs)
The final session turned out to be a boring one with India concentrating on preserving wickets, while South Africa also resorted to defensive tactics.
Tendulkar was lucky when his edge off Tsotsobe flew over the slips for a boundary through the thirdman region, in the second over of the session.
Gambhir also looked in control as he hit a boundary each off Tsotsobe and Morkel in successive overs. The left-hander then cut a short delivery from Paul Harris for another boundary through the covers, his seventh of the innings.
Tendulkar was also keen to keep the runs flowing. He stepped down the wicket to Harris and drove him through the covers for a delightful boundary.
In the next over, Gambhir brought up his half-century from 82 balls in some style as he flicked a full delivery from Tsotsobe through midwicket for a four.
Steyn then came back for a new spell and immediately started testing the batsmen with a probing line and length. In fact, South Africa used Harris from the other end and started choking the runs as just 14 came from ten overs as India reached 121 for two in 40 overs.
Gambhir, on 60, got another lifeline when he was dropped by de Villiers at second slip and once again Tsotsobe was the unfortunate bowler. The Indian opener went after a wide delivery but only got an edge, which de Villiers could not hold on to at second slip.
The two batsmen literally shut shop as both looked to play to the merit of the ball without looking for the boundaries. There were no boundaries hit for the last 23 overs of the session, while the last 20 overs produced just 35 runs.
At close on Day 2, India were 142 for two in 50 overs, still trailing the hosts by 220 runs.
South Africa's bowlers were made to work hard, while their usually high fielding standards dropped as they spilled two easy catches.
Steyn was the only wicket-taker as he took one for 31 in 13 overs, while Tsotsobe was unlucky not to have picked up a couple of wickets.