Dilshan hit two sixes and 21 fours for his sixth Test century as the visitors recovered from a shaky 75-4 to reach a healthy 371-6 in their first innings at stumps after electing to bat.
The middle-order batsman added 119 for the fifth wicket with opener Malinda Warnapura (63) and 173 for the next with Chamara Kapugedera (93 not out) to put Sri Lanka on course for a big total.
Bangladesh's bowlers tasted early successes, with paceman Mashrafe Mortaza (2-48) picking two wickets in his opening two overs and spinner Shakib Al Hasan getting rid of skipper Mahela Jayawardene (11), playing his 100th Test.
But Dilshan's aggressive knock, backed by valuable support from Warnapura and Kapugedera, helped the visitors seize back the initiative.
Warnapura hit six fours in his 151-ball knock before being trapped leg-before by part-time spinner Mohammad Ashraful.
Kapugedera looked set for his maiden Test century, having already hit 12 fours and a six from 117 balls.
But it was