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.
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.
Also Read
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 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.