Dammika Prasad made a handy 36 as Sri Lanka gained a first-innings lead of 147, and then snared the openers.
For 40 minutes before tea India sparkled, but Sri Lanka hit back hard, kept gnawing away, and by stumps had closed in on maintaining their unbeaten home Test series record against India since 1993.
Kumar Sangakkara and the Sri Lankan lower order frustrated India and made them look a sorry bunch for the best part of two sessions, and Dammika Prasad again provided the crucial breakthroughs before the spinners took charge. Ajantha Mendis dismissed Sachin Tendulkar for the first time - his 25th wicket in Tests, making his the best debut in a three-match series.
The two spells of Sri Lankan dominance sandwiched a brisk start by Virender Sehwag and Gautam Gambhir, but the Indian openers played two shots too many. The Fab Four, two of them walking wounded, couldn't come up with resistance enough, bar Rahul Dravid, who struggled and fought his way to his highest score of the series, 46.
After India had fallen behind by 147, Sehwag and Gambhir reacted to the situation the only way they knew, by attacking. There were boundaries in each of the nine overs before tea. Prasad was hit for a first-ball four, as he had been in the first innings. Before many noticed, Sehwag and Gambhir had brought up their fourth half-century partnership in a row. When Gambhir cut Muttiah Muralitharan for a single in the last over before tea, he reached 1000 Test runs.
Like he had in the first innings, Prasad struck, dismissing the two in successive overs. The wickets were more fortuitous this time: Sehwag cut straight to gully, and Gambhir played a pull shot on. Enter Rahul Dravid and Sourav Ganguly, looking determined to play the day out, giving Tendulkar and VVS Laxman, who were both injured, some time to recover.
Dravid and Ganguly managed to put on the longest partnership by any two members of India's big four in the series, but they never got Mendis and Murali out of their faces. It sometimes seemed the two were just delaying the inevitable. Dravid looked more comfortable than he had in the series till then, but he was almost bowled twice, by classical offbreaks from the two spinners - both times he was saved by an inside edge. Ganguly narrowly escaped a stumping, and finally fell while sweeping a Murali doosra.
In came Parthiv Patel, and three balls later, out he went, forcing the injured Tendulkar out into the middle. Tendulkar, his left elbow bandaged, seemed to have made his mind up to not play at most deliveries. Murali thrice came close to getting him lbw, but it was Mendis who finally got him, with a googly Tendulkar did not pick. Not only did an injured Tendulkar never really look comfortable, for the first time in the series, he looked helpless.
It was an interesting comparison: did India look more abject in the final session or the first two, when they were run ragged by Kumar Sangakkara's rediscovered appetite for big runs, and lower-order partnerships? Early in the day they were short on manpower (Ishant Sharma didn't take the field today), and exhausted by the effort of keeping the game in the balance yesterday. Sri Lanka's batsmen made sure they capitalised, and even after Sangakkara was dismissed shortly before lunch, Prasanna Jayawardene and Prasad frustrated the tired Indians. The last three took the lead from 75 to 147.
The spinners persisted in letting Sangakkara take easy singles, but India were slow, both mentally and physically, as they also repeatedly allowed Sangakkara to retain the strike by either not bringing the field up at the end of overs or simply by misfielding.
Sangakkara enjoys it when he has a team down: 11 of his 17 centuries have been scores of more than 150; the lowest he has been dismissed for after having made a century is 128. Today he continued in much the same vein as he had played yesterday, but as if he had started a new innings. The expansive strokeplay was not on offer, as the fields were deep and the bowling defensive. But he didn't miss a single opportunity to convert half-runs.
As the lead passed 50, Sangakkara started to take a few more liberties with the bowling, manufacturing a shot or two. But after seven hours and seven minutes of exceptional batting in the heat of Colombo, he misread the spin on an Anil Kumble delivery, got a thin edge, and walked off. He fell short of what would have been a 12th 150, but his disappointment suggested he had been eyeing a seventh double.
The Sri Lankan tail had some fun after that. The first ball Prasad faced in Test cricket, he sent to the third-man boundary - revenge, perhaps, for being hit for four by Gambhir off the first ball he bowled. The next ball, the first of a Zaheer Khan over, was pulled away through square leg for four by Prasanna, who also came up with an exquisite cover-drive in the same over. Their partnership finally ended at 43, as Prasanna fell one short of a half-century, but that didn't spell relief for India. Mendis and Prasad stuck around for eight overs, surviving bouncers, looking ungainly, and yet managing outrageous boundaries. Mendis was the last man out, but not before he had taken his career runs to within four of his wickets tally.
That wickets tally swelled in the final session by two, and in a testing ten-over spell before stumps it seemed he would take more. But Laxman, nursing an injured left ankle, and Dravid, fighting to keep his reputation intact, saw India through to stumps.