India were eyeing a series- levelling victory in the second cricket Test by reducing Sri Lanka to 72 for two after setting the hosts a daunting victory target of 413, riding on Ajinkya Rahane's sparkling century.
The 27-year-old Rahane (126) notched up his fourth Test century as India declared their second innings at 325 for eight and then snapped up early wickets to leave the islanders in a shaky position at close on an engrossing fourth day.
India will now look to take the remaining eight wickets on a tricky fifth day track to level the three-match series 1 -1 and spoil the party for retiring legend Kumar Sangakkara in his farewell Test match.
Sangakkara, 37, did not have a fairytale ending to his final innings after the one-down batsman departed for just 18 runs. He was scalped for the fourth time in this series by Ravichandran Ashwin (2-27) as the home crowd gave an emotional farewell to the left-handed batsman.
After coming on to the ground amid a standing ovation and guard of honour by the visiting Indian team, Sangakkara was done in by an Ashwin turner to be caught at gully by Murali Vijay. The visiting players, including captain Virat Kohli, then shook hands with the departing Sangakkara as his family looked on from the stands.
Dimuth Karunaratne (25 not out) and skipper Angelo Mathews (23 not out) then stood their ground for an unbeaten 39-run stand to fight on.
The Lankans will look to score the remaining 341 runs for a series clinching victory though that will a tough task. With two wickets already down, they will try to bat out for a draw on a P Sara oval track, which is expected to deteriorate and assist the spinners.
No team has ever scored 413 in the last innings of a Test match on Sri Lankan soil. The highest successful run chase has been achieved by Pakistan only a few months back, when they scored 382 for three against the Lankans in Pallekele.
The highest fourth innings target successfully chased by the hosts has been 352 against South Africa in Colombo in 2006.
The highlight of the day was Rahane's knock and his 140- run second wicket partnership with Murali Vijay (82), which put India in a position to take a mammoth overall lead. Rohit Sharma chipped in with a useful 34 before India declared the second innings.
Dhamikka Prasad and Tharindu Kaushal picked up four wickets apiece but failed to stop the flow of runs.
Ashwin had opened the bowling along with Umesh Yadav (0- 10) and made immediate impact with the new ball. In the 3rd over Kaushal Silva (1) played a loose shot off a full toss and hit it straight to short mid-wicket.
Sangakkara then put on 25 runs for the 2nd wicket with Karunaratne before Ashwin dismissed him.
Mathews came in next and survived the 12.1 overs before stumps. Ishant Sharma (0-18) and Amit Mishra (0-13) were the other bowlers deployed.
Earlier, after tea, India continued to bat on and didn't declare until they were eight wickets down. Stuart Binny (17) was gone first ball after the break and to everyone's surprise Wriddhiman Saha (13*) came out to bat, despite a right hamstring strain. Later he didn't keep wickets as Lokesh Rahul donned the gloves.
At the other end, Ashwin (19) was accounted by Dhammika (4-43) after he threw his bat around and helped India clear the 400-run mark in terms of overall lead.
Mishra (10) was dismissed, again off Prasad in the 89th over, and Umesh (4*) batted a bit too as India played for comfort. The declaration finally came after 91 overs after the visitors added another 42 runs in 9 overs after tea. Rangana Herath (0-96), Angelo Mathews (0-1) and Dushmantha Chameera (0-63) were the other bowlers tried out earlier in this innings.
After lunch, India started from 179/3 as Rahane and Rohit looked to get runs quickly to press for an early declaration. But Sri Lanka had their own plans to keep things tight, and with Kaushal (4-118) bowling round the wicket to the two right-handers, they were successful in their ploy.
The scoring rate fell below three-per-over as Rohit took time to settle down. In the meantime, Rahane completed his Test hundred off 212 balls in the 67th over. India's lead swelled to 300 in the same over, even though only 42 runs came in the first hour of play after lunch.
Slowly though, the two batsmen started attacking and playing shots and the run-rate went past the four-per-over mark. Rohit perished in trying to clear the boundaries and was caught in the deep off Kaushal in the 75th over. Two overs later, the off-spinner also accounted for Rahane who edged one to the keeper.
It brought Binny and Wriddhiman Saha (5 retd.) together at the crease, but the latter retired hurt in the 79th over due to a strained right hamstring. He left the field to get treatment and it is suggested that he will be fit enough to keep wickets. Lanka took the new ball as soon as it was due but Binny and Ashwin managed to avoid any further damage before the final session of play.
In the morning session, Vijay and Rahane scored half- centuries and put on 140 runs for the second wicket. Starting at the overnight score of 70 for one, Vijay (39*) and Rahane (28*) looked to get into their grooves as soon as possible. They started slowly but the scoring pace increased soon after. Vijay first brought up his 11th Test half-century in the 36th over, off 104 balls, and as if that was the cue for going after the bowling, he hit two sixes thereafter.
At the other end, Rahane tried the calm approach and yet kept the scoring rate up, reaching his fifty off 118 balls in the 39th over. It also brought the 100-partnership up for the two batsmen, while India's 100-mark had come earlier in the 38th over. The aggressive intent of both batsmen was clearly towards a declaration later in the day and they scored 68 runs in 13.4 overs in the first hour at about five runs per over.
In the second hour of play though, Sri Lanka fought back and applied brakes on the scoring with two wickets. Vijay was the first to go, out LBW to Kaushal in the 46th over. Skipper Virat Kohli (10) came out to bat and he wasn't given any free boundaries to get off the mark quickly with the off-spinner coming round the wicket.
He was out LBW in the 53rd over as Rohit came out to bat with a few minutes left for the break. He did well enough to bat out the remaining session without any further losses, still keeping India on track for a 350-plus lead target.