Virender Sehwag (85), who payed with his usual flamboyance, and VVS Laxman (18) ensured that there were no more setbacks as they took the score to 140 for three at close on the third day with the hosts still trailing by 380 runs.
With two days left in the match and the pitch at the Galle International stadium expected to deteriorate, the Indians need to bat out of their skin to ensure that Muttiah Muralitharan's swansong Test ends in a draw.
The day clearly belonged to the hosts as they not only consolidated their position by amassing a huge score but also scalped three prized wickets.
While Gambhir perished in Malinga's first over, Dravid was run out trying to go for a cheeky single. But the biggest blow for the visitors came when Tendulkar was trapped leg before by Muralitharan.
Earlier, the Indians managed to claw back into the game to some extent in the pre-lunch session as they evicted Tharanga Paranavitana (111), Thilan Samaraweera (0), Mahela Jayawardene (48) and Angelo Mathews (41).
But the late order belligerence of Herath and Malinga took the game completely away from the Indians.
After the second day was completely washed out, play resumed on Tuesday after an hour's delay with Sri Lanka at 256 for two and the Indians managed to get a few quick wickets in the opening session.
Ishant, who has been struggling for quite some time, tasted his first success when he induced a nick from centurion Paranavitana which went straight to wicketkeeper Dhoni.
Paranavitana (111) poked at the moving delivery off the backfoot and the diving Indian skipper made no mistake. Debutant Abhimanyu Mithun then struck another blow to the Lankan line-up when he had new batsman Thilan Samaraweera (0) trapped leg before.
The ball that slanted in late caught Samaraweera unawares and the Hawkeye showed the it may have just kissed the top of the middle stump.
Samaraweera had earlier got a reprieve when Rahul Dravid dropped a sitter off the bowling of Mithun at first slip. The outside edge looped up and carried straight into Dravid's lap but failed to stick.
However, former Lankan skipper Jayawardene took a measure of the Indian fast bowlers as he cut a Mithun bouncer over the slip cordon for a boundary.
Jayawardene later got the benefit of the doubt when his attempted sweep popped into Gautam Gambhir's hand at short leg. The third umpire ruled that the ball had bounced before carrying to Gambhir.
Dhoni decided to bring back the fast bowlers in pursuit of further wickets as both Mathews and Jayawardene showed little difficulty in playing the spinners.
Ishant was unlucky not to get early breakthroughs as he troubled the batsmen but finally got Jayawardene (48) who missed an attempted flick and was trapped leg before wicket.
Ishant then got Mathews as he nipped an away going delivery to be neatly taken by Laxman at second slip.
The hosts tightened their grip on the match in the post lunch session with Herath and Malinga proving quite a handful for the tired Indian bowlers.
Malinga, who hit Pragyan Ojha for two sixes, celebrated his maiden half century in Test cricket.
The gritty batsman finally fell when he scooped an Abhimanyu Mithun delivery into the waiting hands of Harbhajan at fine leg.
Earlier, in an apparent attempt to accelerate, newcomer Prasanna Jayawardene hammered Harbajan Singh to the midwicket for the first six of the match.
Making it an expensive over for Harbhajan, Prasanna swept a flighted delivery on middle stump to the midwicket boundary. It was left to Mithun to bring to an end the dangerous looking batsman's innings.
Prasanna, who was looking to play it to the leg side after moving across the stump, missed the ball and got hit on his pads in the middle stump and the umpire had no hesitation in declaring him LBW.
It was then Herath and Malinga who took centre stage with a some blistering shots which entertained the sparse crowd at the Galle International stadium.
After Malinga's dismissal, Muttiah Muralitharan walked in for his last Test appearance and was accorded a grand welcome with fireworks bursting all around.
In a touching gesture, the Indian players also greeted Muralitharan with a guard of honour as he stepped out to bat.