Dilshan hit 112 and shared in a first-wicket stand of 74 with Tharanga Paranavitana (35) and 115 for the next with skipper Kumar Sangakkara (31) to help the tourists make a solid reply on a good batting pitch at the Motera.
Left-arm pace bowler Zaheer Khan struck crucial blows for India when he dismissed Dilshan and Sangakkara in successive overs but Mahela Jayawardene (36 not out) and Thilan Samaraweera (45 not out) made sure no more wickets fell with a stand of 81.
Dilshan, who scored 92 and 123 not out in the first test against New Zealand in August, recorded his 10th test hundred that featured some fine strokeplay.
Dilshan struck 12 fours and reached his century with a spanking cut for a boundary off Ishant Sharma, but fell to a soft dismissal when he top-edged a slash off Zaheer to be caught by Rahul Dravid running in from gully.
Zaheer, returning from a long injury layoff, forced Sangakkara to miscue a hook in his following over to be caught by Sachin Tendulkar at fine leg.
But former captain Jayawardene and Samaraweera batted with patience and poise as Sri Lanka steadily built on Dilshan’s magnificent effort.
Sri Lanka, who are ranked second behind South Africa in the official test rankings, are aiming to win a test on Indian soil for the first time.
India were bowled out in the morning for the addition of 41 runs to their overnight score and their spinners struggled to derive purchase.
Sri Lanka fast bowler Chanaka Welegedara claimed the prize wicket of Dravid in the third over of the day to provide the visitors with an early breakthrough.
Former captain Dravid failed to improve on his overnight score of 177 which had helped the hosts recover from 32 for four to finish the first day on 385 for six.
Welegedara, playing in a test for the first time in two years, forced Dravid to edge onto the stumps to finish with four for 87.
Spinner Muttiah Muralitharan, whose appearance in the three-match series will be his last overseas test tour, claimed the final two wickets in the same over to finish with three for 97.
SCOREBOARD
India first innings (385-6 overnight)
G. Gambhir b Welegedara 1
V. Sehwag lbw b Welegedara 16
R. Dravid b Welegedara 177
S. Tendulkar b Welegedara 4
V. Laxman b Prasad 0
Y. Singh c Dilshan b Muralitharan 68
M. Dhoni c P. Jayawardene b Prasad 110
H. Singh b Muralitharan 22
Z. Khan lbw b Herath 12
A. Mishra not out 7
I. Sharma st P. Jayawardene b
Muralitharan 0
Extras (b-2, lb-2, w-1, nb-4) 9
Total (all out, 104.5 overs) 426
Fall of wickets: 1-14 2-27 3-31 4-32 5-157 6-381 7-389 8-414 9-426
Bowling: Welegedara 22-4-87-4 (nb-1, w-1), Prasad 22-1-106-2 (nb-2), Mathews 12-1-50-0, Muralitharan 25.5-4-97-3 (nb-1), Herath 22-2-79-1, Dilshan 1-0-3-0.
Sri Lanka first innings
T. Dilshan c Dravid b Zaheer 112
T. Paranavitana c Dhoni b Ishant 35
K. Sangakkara c Tendulkar b Zaheer 31
M. Jayawardene not out 36
T. Samaraweera not out 45
Extras (lb-5, w-2, nb-9) 16
Total (three wickets; 70 overs) 275
Fall of wickets: 1-74 2-189 3-194
To bat: A. Mathews, P. Jayawardene, D. Prasad, R. Herath, M. Muralitharan, C. Welegedara.
Bowling (to date): Zaheer 15-2-45-2 (w-1, nb-3), Ishant 14-0-53-1 (w-1, nb-3), Harbhajan 20-2-72-0, Mishra 18-0-89-0 (nb-3), Yuvraj 3-0-11-0.