Sri Lankan captain Mahela Jayawardene declared his team's first innings at 451-6 soon after Sangakkara reached his fifth double century in the final session of the second day's play.
Bangladesh, trailing by 389 runs, were reduced to 69-4 in their second knock by stumps despite a brisk start of 48 runs in six overs by openers Javed Omar and Shahriar Nafees.
The innings fell apart when Chaminda Vaas had Nafees caught behind for 20 and trapped Omar leg-before for a 23-ball 28.
Dilhara Fernando dismissed Rajin Saleh for zero and Mehrab Hossain for eight to leave Bangladesh facing another big defeat after losing last week's first Test by an innings and 234 runs.
Captain Mohammad Ashraful (seven) and his predecessor Habibul Bashar (three) were at the crease when play ended.
Left-handed Sangakkara, who took a break from his services with English county Warwickshire to play in the home series, reached his 13th Test century shortly before lunch by lofting Mohammad Rafique for a six.
He anchored the innings for eight hours with an unblemished knock that contained 20 boundaries and two sixes.
Sangakkara was involved in three big stands, adding 128 for the second wicket with Malinda Warnapura, 98 for the third with skipper Mahela Jayawardene and 92 for the fourth with Chamara Silva.
Warnapura was the lone batsmen to be dismissed in the extended morning session for 82 after Sri Lanka resumed at their overnight score of 154-1.
Warnapura, nephew of Sri Lanka's first Test captain Bandula Warnapura, had failed to get off the mark on his debut in the opening Test.
The left-hander made amends by making 79 on Tuesday, but added only three more runs in 40 minutes on the second morning when he miscued a hook off Shahadat Hossain to be caught at mid-wicket.
Warnapura put on a century stand with Sangakkara to revive Sri Lanka after opener Michael Vandort had fallen cheaply for 14 the previous day.
Jayawardene, who was on 49 at lunch, failed to add another run as he top-edged a hook off Shahadat to Nafees at square-leg in the second over after the break.
Bangladesh bowlers kept a steady line and length to check the flow of runs, but their good work was undone by sloppy fielding that afforded the Sri Lankan captain two lives.
Jayawardene had not scored a run when he edged Mashrafe Mortaza between wicket-keeper Mushfiqur Rahim and first slip Bashar. Neither went for the waist-high catch.
Jayawardene then saw left-arm spinner Rafique put down a simple return catch when he was on 28.
Debutant left-arm spinner Mehrab slowed Sri Lanka's progress in the afternoon session by removing Silva and Tillakaratne Dilshan in the space of three deliveries.
Vaas, who hit a maiden hundred in the first Test, remained unbeaten on 30.