Sri Lanka couldn't get Virender Sehwag out, but Ajantha Mendis found a way around him, dismissing most of the others cheaply before Harbhajan Singh enacted a similar turnaround to restore the balance at the end of day two in Galle.
It was an eventful three sessions: Sehwag was imperious as he scored his fifth double-century while losing partners at the other end; Malinda Warnapura and Kumar Sangakkara threatened to run away with the match, but Harbhajan pulled Sri Lanka back with a four-wicket burst in the final session.
Sri Lanka dismissed the last six Indian batsmen for 51 runs; India replied by taking four of their top- and middle-order batsmen for 55. When Sangakkara and Warnapura were going hell for leather, it seemed they might take Sri Lanka's second innings out of the equation, but then Harbhajan came up with one of his best spells in recent times.
Warnapura, especially, showed he had learned a lesson or two from Sehwag. He saw his opening partner, Michael Vandort, get out in the first over, and then played at and missed a few times against Zaheer. But all along he kept punishing even the smallest errors of length. Zaheer's fourth over was the most expensive of the series: Warnapura took four successive boundaries to reach 24 off 18 balls.
With Sangakkara looking determined to set right a minor dip in his form, the Indian bowlers looked helpless. Sri Lanka raced to 50 in 8.5 overs, and by the time spin was introduced Sri Lanka had scored 60 for 1 in 11 overs. Anil Kumble and Harbhajan brought in some control, but their fortunes were not changing just as yet: just before tea, Dinesh Karthik made a mess of a regulation stumping chance off Harbhajan when he couldn't even collect the ball with Sangakkara way down the wicket.
When India came back from tea, they continued with the pressure tactics, and Warnapura yielded, giving Gautam Gambhir a difficult low catch at short cover. The ten overs preceding that dismissal had yielded 15 runs. Harbhajan took heart from that wicket and got a leading edge from Sangakkara, which he caught himself, just in case. Two new batsmen were in, and Kumble and Harbhajan were finally being treated with the sort of respect they have been used to.
Harbhajan went round the stumps and trapped Thilan Samaraweera with a slider. In the same over, he got Tillakaratne Dilshan with one that bounced and turned in sharply. In the dying overs Harbhajan came close to getting his fifth twice: first he beat Mahela Jayawardene with a sharp offbreak from round the stumps; the field-umpire thought it would have gone down the leg side, and the review said no different. Prasanna Jayawardene offered Gambhir a sharp chance at forward short-leg, but Gambhir couldn't cap the good day he had had in the field with another catch.
The collapse that Sri Lanka faced paled in comparison with the two India had endured. India went from 167 for 0 to 178 for 4, and then from 278 for 5 to 327 all out, and both collapses were triggered by Mendis, who was facing the first big test of his short career. Sehwag read him and went after him, taking 70 runs off the 77 deliveries he faced from him. But that failed to intimidate Mendis, who stayed accurate, made the batsmen play almost every ball, and earned his first five-for in Tests.
After the wicket of VVS Laxman, who took his overnight stand of 36 with Sehwag to 100 before hitting a long hop from Mendis straight to midwicket, Mendis began to toy with the tail. Karthik seemed in no mental shape to play high-quality spin bowling; his lack of confidence showed when he didn't ask for the review after he was eventually given out: replays indicated the top-spinner from Mendis would just have brushed off stump. Mendis then repeated the now-famous carrom ball that got Rahul Dravid in the first Test to Harbhajan Singh, breaking it away rapidly and taking the top of off.
Mendis then repeated the now-famous carrom ball that got Rahul Dravid in the first Test to Harbhajan Singh: it broke away at a rapid pace and took the top of off.
The story of the day, though, remained Sehwag, who scored 61.09% of India's runs. This was the 11th consecutive hundred he had converted into a 150-plus score. He also became the second Indian to carry his bat through, and passed 5000 career Test runs.
It is a shame that some of Sehwag's best innings have come when his team-mates have been struggling for form. Only two of his 15 centuries - all scored at a maddening pace - have resulted in victories for India. After many a quick Sehwag hundred, the other batsmen have either folded or slowed the pace down so much as to deprive the bowlers of sufficient time in which to force a result. Something similar seemed on the cards here, but the difference this time was that Sehwag was around for the duration to make amends for the collapses.
Muttiah Muralitharan, surprisingly ineffective in the innings, began bowling with an in-and-out field. Sehwag smartly resorted to opening the face of his bat and finding twos. Mendis, back for a new spell, was welcomed with a six; the off stump at the non-striker's end prevented another certain boundary in the same over.
As the wickets fell, Murali at the other end started to rip his doosras, ending Anil Kumble's resolute innings, and Zaheer Khan's brief one. When Zaheer, the No. 10, launched into an irresponsible sweep off Murali, Sehwag was on 195. At 199, with just two overs to lunch, Sehwag refused the single twice, preferring to shield Ishant Sharma rather than get to the landmark. Off the last ball of the over, he then nonchalantly flicked to deep square-leg for a single.
The rest of his team owed him an apology for the lack of support - 307 of their 326 runs were scored by three batsmen - and Harbhajan went some way towards doing so. Whether it was enough remained to be seen.