Sri Lanka were struggling at 67-3 after being put in to bat, but left-handed opener Tharanga (57) and Silva (65) propped up the innings with an 83-run stand for the fourth wicket.
Bangladesh, blanked in the preceding three-Test series, rattled the hosts in the early overs with left-arm seamer Syed Rasel grabbing two wickets and paceman Mashrafe Mortaza one in their opening spells.
Sanath Jaysuriya (21), Kumar Sangakkara (16) and skipper Mahela Jayawardene (two) fell cheaply before Tharanga and Silva came to their team's rescue with responsible knocks.
Tharanga struck seven fours in his ninth half-century, while Silva hit one six and eight fours before being trapped leg-before by Bangladeshi left-arm spinner Abdur Razzaq.
Bangladesh had opportunities to restrict Sri Lanka to a modest total but floored three catches early in the innings.
Sri Lanka suffered a blow when veteran opener Jayasuriya was bowled by Rasel, just two balls after he had hit the same bowler for a six over midwicket.
Wicket-keeper Sangakkara, who hammered back-to-back Test double-centuries, was caught behind off Mortaza, while the Sri Lankan captain played a loose drive and was caught by Shakib-Al Hasan in the covers.
Sri Lanka plundered 70 runs in the last 10 overs, thanks to Tillakaratne Dilshan (24) and Jehan Mubarak (22 not out).
Dilshan was caught by Bangladesh skipper Mohammad Ashraful in the covers, the bat slipping out of his hands while he tried to play a shot off Mortaza.