The tourists were 708 for five at lunch on day four with overnight batsmen Mahela Jayawardene remaining unbeaten on 267 and wicketkeeper Prasanna Jayawardene on 134 not out.
The two Jayawardenes extended their sixth-wicket record overnight stand to 333 as Sri Lanka, 591 for five overnight, posted the highest innings score in India by any team.
The tourists put on another 117 runs in the day’s opening session without losing a wicket and former captain Mahela Jayawardene, 204 overnight, became the ninth batsman to reach the 9,000-run mark in test cricket when he reached 253.
Earlier, centuries by Rahul Dravid (177) and skipper Mahendra Dhoni (110) helped India recover from 32 for four and post a healthy 426 after choosing to bat first in the three-test series.
Opener Tillakaratne Dilshan stroked his fifth test century of the year on the second day to set up Sri Lanka’s strong reply.
India took the third new ball at the overnight score without effect as Mahela Jayawardene, who recorded his sixth double hundred on Wednesday, toyed with the bowling.
Prasanna Jaywardene, 84 overnight, recorded his second test century, and fifth century of the match, when he guided pace bowler Ishant Sharma to the third man fence in what was another frustratingly unproductive session for India.
The stylish Mahela Jayawardene brought up his 250 with a single from off-spinner Harbhajan Singh and was batting with poise as he approached his second triple century.
Only Australia’s Don Bradman, West Indian Brian Lara and India’s Virender Sehwag have hit two triple centuries each in test cricket.