Sri Lanka ended day two on 28-1 in their second innings after India set them a mammoth target of 447 for victory in the second and final Test on Sunday.
Jasprit Bumrah struck in the first over to trap opener Lahiru Thirimanne lbw for a duck but skipper Dimuth Karunaratne (10) and Kusal Mendis (16) saw out the final few overs of the day, with the tourists still 419 runs behind.
Having bowled out Sri Lanka for 109 in the first session, India batted 69 overs before declaring on 303-9 with Shreyas Iyer and Rishabh Pant notching up half-centuries while other Indian batsmen failed to go on from solid starts.
Skipper Rohit Sharma, playing his 400th international match, holed out in the deep to fall four runs short of his fifty while Hanuma Vihari (35) was bowled by spinner Praveen Jayawickrama as he tried to sweep.
Jayawickrama struck again to surprise Virat Kohli (13) with a delivery that turned sharply and kept low, trapping him lbw in identical fashion to his dismissal in the first innings.
Kohli gave a wry smile as silence descended on the M Chinnaswamy Stadium with a near-capacity crowd hoping to see the former captain and star of the IPL franchise end his century drought.
But Pant took the game away from the Lankans by going after the bowling as soon as he walked to the crease, bringing up his fifty with seven fours and two sixes.
Made from 28 balls, his half century was the fastest by an Indian batsman, breaking the record set by Kapil Dev 40 years ago, before he skied a delivery from Jayawickrama who took the catch himself.
Iyer helped guide India to a lead beyond 400 with his second half-century of the match to add to his fine knock of 92 on a turning track in the first innings.
With nine boundaries, Iyer looked comfortable at the crease before he was outfoxed by a Lasith Embuldeniya delivery that rapped him on the pads and sent him back to the pavilion for 67.
Fast bowler Suranga Lakmal, playing in his final match before retirement, went wicketless in the second innings but he led the tourists off the field, with India coach Rahul Dravid also shaking his hand.
Earlier, Sri Lanka had resumed day two on 86-6 but their resistance lasted only 27 minutes as Bumrah (5-24) and Ravichandran Ashwin (2-30) cleaned up the tail.
Bumrah claimed his eighth five-wicket haul and his first on home soil on a pitch heavily favouring spinners.