The hosts, who bowled out Bangladesh for 131 in the first innings, replied with 316-2 by tea on the third day at the Asgiriya stadium, a lead of 185 runs with eight wickets in hand.
Jayawardene and his deputy Sangakkara took advantage of two rain-free sessions to put on 242 for the unbroken third wicket and lift Sri Lanka towards a big first innings total.
Left-handed Sangakkara followed up his unbeaten double century in the second Test with 122 not out. He has so far hit 16 boundaries in his 14th Test hundred.
Jayawardene, who made 127 in the first Test, survived a confident leg-before appeal on zero to return unbeaten on 130. His 18th Test century is studded with 12 fours and two sixes.
Sri Lanka, seeking a 3-0 sweep of the series after winning the first two Tests, recovered ground after frustrating rain interruptions on the previous two days restricted play to only 57.3 overs.
Jayawardene and Sangakkara, who resumed after lunch on 161-2, punished the wayward Bangladeshi bowling by hammering 155 runs in the two-hour afternoon session.
Both batsmen raced neck-to-neck towards three figures, but Jayawardene got there first with a fine cut off his Bangladeshi counterpart Mohammad Ashraful for two runs.
Sangakkara, who was on 95 at that stage, reached his own landmark in Ashraful's next over by driving him through the covers for his 14th boundary.
Bangladesh's left-arm seamer Syed Rasel, who moved the ball about in overcast conditions in the morning session, was rewarded with the wickets of openers Upul Tharanga and Michael Vandort in his opening spell.
Tharanga, returning to the side after missing the previous two Tests with a heel injury, made 12 when he shouldered arms to an incoming ball and was given out leg-before by Indian umpire Suresh Shastri.
Vandort, who took the help of a runner due to an ankle injury sustained while batting on Thursday, took his overnight score of 25 to 43 when he was bowled by Rasel to make Sri Lanka 74-2.
Rasel was unlucky not to get a third wicket when Shastri turned down an appeal for leg-before against Jayawardene before the Sri Lankan captain had got off the mark.
Television replays indicated it was a marginal decision that could have gone either way.
Brief Score (at tea, D-3):
Bangladesh Ist innings 131 Vs Sri Lanka 316 for 2 (Jayawardene 130 n o, Sangakkara 122 n o, Vandort 43; Syed Rasel 2 for 71).