Kolkata: Openers Shikhar Dhawan and Lokesh Rahul featured in a rollicking 166-run stand to help India erase the 122-run lead they had conceded to Sri Lanka on the penultimate day of the opening Test on Sunday.
Dhawan threw away his wicket at 94, but Rahul was unbeaten on 73 when bad light stopped play with the hosts on 171 for one.
Cheteshwar Pujara was on two at the other end with India 49 runs ahead with nine wickets in hand, an impressive fightback after being all out for 172 in their first innings.
The hosts had lost the entire top half of their batting order by the time they had accumulated 50 runs in the first innings but Rahul and Dhawan ensured there was no repeat by scoring at nearly four-and-half runs an over.
Dhawan was decisive with his footwork against the slow bowlers, which he demonstrated with two sixes off Sri Lanka's spin spearhead Rangana Herath.
The left-hander also hit 11 boundaries before rushing out to hit Dasun Shanaka before being caught behind.
Rahul was his elegant self at the other end as the right-hander registered his ninth 50-plus score in his last 11 Test innings, which included eight crisp boundaries.
Earlier, Sri Lanka were dismissed for 294 in their first innings after number nine batsman Herath top-scored for the tourists with a defiant 67.
Paceman Mohammed Shami, who bowled without success on Saturday, claimed four wickets, including that of overnight batsmen Niroshan Dickwella and Dinesh Chandimal, in a fine display of seam bowling to curb Sri Lanka's progress.
Dilruwan Perera featured in a review drama after being adjudged lbw to Shami.
The batsman appeared to be on his way back to the dressing room when he suddenly turned around to challenge the decision, which was overturned as the point of impact was found to be marginally outside the stumps.
Shami had the last laugh though, as he dismissed Perera caught behind for five.
Conditions on the first two days of the pace-dominated contest meant Herath had a very limited role with the ball and the spinner made his mark with the bat instead, frustrating the hosts with his dogged resistance.
Shami and Bhuvneshwar Kumar, who claimed four wickets apiece, combined to dismiss Herath with the former taking the catch after the batsman had sliced Kumar to backward point.
India 1st innings: 172
(C. Pujara 52; S. Lakmal 4/26)
Sri Lanka 1st innings
Sadeera Samarawickrama c Saha b B. Kumar 23
Dimuth Karunaratne lbw B. Kumar 8
Lahiru Thirimanne c Kohli b U. Yadav 51
Angelo Mathews c Rahul b U. Yadav 52
Dinesh Chandimal c Saha b Shami 28
Niroshan Dickwella c Kohli b Shami 35
Dasun Shanaka lbw B. Kumar 0
Dilruwan Perera c Saha b Shami 5
Rangana Herath c Shami b B. Kumar 67
Suranga Lakmal b Shami 16
Lahiru Gamage (not out) 0
Extras (b-4, lb-4, w-1) 9
Total (all out, 83.4 overs) 294
Fall of wickets: 1-29, 2-34, 3-133, 4-138, 5-200, 6-201, 7-201, 8-244, 9-290.
Bowling: B. Kumar 27-5-88-4; M. Shami 26.3-5-100-4; U. Yadav 20-1-79-2 (w-1); R. Ashwin 8-2-13-0; V. Kohli 1.1-0-5-0; R. Jadeja 1-0-1-0.
India 2nd innings
L. Rahul (not out) 73
S. Dhawan c Dickwella b Shanaka 94
C. Pujara (not out) 2
Extras (nb-1, w-1) 2
Total (1 wkts, 39.3 overs) 171
Fall of wickets: 1-166.
To bat: V. Kohli, A. Rahane, W. Saha, R. Ashwin, R. Jadeja, B. Kumar, M. Shami, U. Yadav
Bowling: Suranga Lakmal 8-0-29-0; Lahiru Gamage 9-0-47-0 (nb-1); Dasun Shanaka 9.3-1-29-1 (w-1); Dilruwan Perera 10-1-41-0; Rangana Herath 3-0-25-0.
Umpires: Richard Kettleborough, Nigel Llong
TV umpire: Joel Wilson
Match referee: David Boon