The session belonged to Pandya, who built crucial partnerships including a 62-run eight-wicket stand with Kuldeep Yadav.
In what was quite an eventful day of Test cricket at the Pallekele International Stadium, India took complete control of the game after Sri Lanka's fighting display on the first day.
India were bowled out in 122.3 overs post lunch.
India scripted massive innings and 171-run victory over Sri Lanka in the third Test at Pallekele.
Kuldeep Yadav was the pick of the bowlers with a four-wicket haul, while Shami and Ashwin picked up two wicket each.
Mohammed Shami led the attack well with the new ball.
Rahul, who scored his seventh consecutive Test fifty, was the first to go after mistiming a drive to mid-on off Pushpakumara. The ball took extra bounce and lobbed off his glove as the batsman was caught at slip in the third over of the morning.
Sri Lanka were all-out for 135 runs, which is their lowest total in the first innings against India at home.
Kusal Mendis (18) was then run out after a mix-up with Chandimal before former captain Angelo Mathews fell leg before to medium-pace bowling all-rounder Hardik Pandya without scoring.
The match will remembered for India's Hardik Pandya hitting his maiden worldwide century, scoring 108 off just 96 balls, while he also took a record 26 runs off one over from left-arm spinner Malinda Pushpakumara.
Earlier, as the day began, Pandya and Wriddhiman Saha (16) looked to bat for time in a bid to resurrect India's floundering first innings. We look forward to playing Test cricket with the same kind of excitement.
The in-form Cheteshwar Pujara (8), last Test's centurion Ajinkya Rahane (17) were dismissed cheaply while skipper Virat Kohli (42) was dismissed after getting set.
The hosts, who also suffered heavy defeats in Galle and Colombo inside four days, were made to follow on and reached 19 for one at close of the second day's play, still trailing by 333 with nine second innings wickets in hand.
Pandya then went into overdrive and put on 20 runs with Shami (8), whilst reaching his half-century off 61 balls.
"The bowlers came and bowled pretty well".
"Our batting and bowling was below-par through the series", Chandimal said after his team's failure to make any of the tests last full five days. Soon a tweak was made in the celebration as Shikhar Dhawan from the stands prompted Pandya to copy his two-peace celebration style, which the 23-year-old duly accepted.