Skipper Virat Kohli kept India afloat with a valiant 85 but the visitors were still in a spot of bother, finishing day two at 183 for five in the second cricket Test against South Africa, in Centurion on Sunday.
Kohli held together India's innings with a classy unbeaten 85 which came off 130 balls and was studded with eight boundaries.
Hardik Pandya (11 not out) was giving Kohli company at the crease as India reached the total in 61 overs at stumps in reply to South Africa's 335 all out in their first innings
The duo added 19 runs for the unbeaten sixth wicket.
Kohli led India's response but South Africa kept chipping away with wickets at the other end to end the second day firmly in front.
The visitors, who are down 0-1 in the three-match series, still trail South Africa by another 152 runs.
Opener Murali Vijay scored a gritty 46 off 126 balls before being dismissed by left-arm spinner Keshav Maharaj.
When the rest of the Indian batsmen looked in discomfort against the South African bowling attack, Kohli was at his positive best as he played his shots with consummate ease from the onset.
Kohli, who faced flak for his lack of runs in the first Test and his selection decisions in the ongoing match, paced his innings to perfection and attacked the Protea bowlers when opportunity came his way.
Together with Vijay, Kohli added 79 runs for the third wicket as India crossed 100 in the 33rd over.
But South Africa got the breakthrough soon when Vijay was caught behind off Maharaj (1/53).
Kohli, meanwhile, scored his 16th Test half-century off 68 balls and was inclusive of seven boundaries. The skipper also added 25 runs with Rohit Sharma (10) for the fourth wicket.
But Rohit once again fell cheaply, out lbw to Kagiso Rabada (1/33). The batsman went for review but was given out on umpire's call with the ball clipping the top of middle stump.
Lungi Ngidi (1/26) then had Parthiv Patel (19) caught behind in the 54th over to reduce India to 164 for five.
Patel had put on 32 runs with Kohli for the fifth wicket but became Ngidi's maiden Test wicket just as the innings started to look stable.
Pandya then joined Kohli in the middle and the duo managed to see off the remainder of the session without any further loss.
Earlier in the post lunch session, Vijay and KL Rahul (10) started watchfully against South Africa's pacers. They added 28 runs for the opening stand. Rahul had looked rusty, particularly against Morne Morkel's (1-24) bounce, and only ended up returning a catch, which the bowler grabbed in a diving effort to the left.
Immediately on the next ball, Cheteshwar Pujara was run- out for his career's first golden duck as he set off on a suicidal run and failed to beat Lungi Ngidi's throw from mid-on.
Vijay too had a couple nervy moments against Vernon Philander but managed to survive the spell. He then settled down to aid Kohli in India's recovery.
India crossed 50 in the 16th over as Kohli looked in good touch from the very start. He set off with a flurry of boundaries and quickly outscored Vijay. The duo put on 50 runs off 101 balls.
Ngidi bowled a fiery first four-over spell on Test debut, egged on by the home crowd, but he couldn't etch out a breakthrough before tea.
This was after South Africa were bowled out for 335 runs (113.5 overs) in their first innings just before lunch. R Ashwin finished with 4/113 and Ishant Sharma took 3/46 as the Proteas lost their last seven wickets for 89 runs.
Starting from overnight 269/6, Faf du Plessis (63) and Keshav Maharaj (18) took their seventh wicket stand to 31 runs.
India wasted their last DRS review early in the day as Jasprit Bumrah (0/60) looked for an early LBW call against Maharaj.
Mohammed Shami (1/58) bowled a lively spell and got the breakthrough with Maharaj caught behind in the 99th over.
India made a double howler in the 104th over. First, Kagiso Rabada (on 1) was dropped at slip off Ashwin by Kohli. On the very next ball, Rabada (on 3) was again dropped by Pandya at point as Shami obstructed him whilst running in from short third-man.
South Africa then crossed 300 in the 106th over, while Du Plessis reached his 17th Test half-century off 127 balls. In doing so, he put on 42 runs with Rabada (11).
India finally got the delayed breakthrough in the 111th over as Pandya held a smart catch off Ishant in the deep. Two overs later, Ishant also bowled du Plessis to change the course of the morning session again.
Ashwin then wrapped up the South African innings as Morne Morkel (6) holed out to long off.