Pant took the game away from the Sri Lankans on Sunday by going after the bowling as soon as he walked to the crease and the wicketkeeper quickly brought up his fifty with seven fours and two sixes.
Made from 28 balls, his half century was the fastest-ever by an Indian batsman in a Test, breaking the record set by Kapil Dev 40 years ago.
But his risk-taking style also proved to be his downfall when he skied a delivery from spinner Praveen Jayawickrama (3-50), who took the catch himself.
Shreyas Iyer (18) and Ravindra Jadeja (10) were at the crease at the interval.
Having bowled out Sri Lanka for 109 in the first session, India lost Mayank Agarwal after a 42-run opening stand but skipper Rohit Sharma and Hanuma Vihari kept the momentum going with the first 50-run partnership of the match.
But Rohit, playing his 400th international match, holed out in the deep to fall four runs short of his half-century before Vihari (35) was bowled by 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.
A frustrated Kohli could do nothing but give a wry smile as silence descended on the M Chinnaswamy Stadium, where a near-capacity crowd had hoped to see the former captain and star of their IPL franchise finally end his century drought.
Earlier, Sri Lanka had resumed on 6-86 but their resistance lasted only 27 minutes as Jasprit Bumrah (5-24) and Ravichandran Ashwin (2-30) cleaned up the tail to give the hosts a 143-run advantage before the second innings.
Bumrah's fiery spells gave him his eighth five-wicket haul but his first on home soil on a pitch heavily favouring the spinners.