Sri Lanka won the toss and decided to bat first, but lost both their openers within four overs.
Taskin struck hard early on, trapping in-form opener Pathum Nissanka LBW for one run, then dismissing second opener Avishka Fernando for four in her next over.
Mustafizur Rahman, playing his first match in the series, restricted Sri Lanka to 41-3 by dismissing Sadira Samarawickrama for 14 runs on his very first ball.
Leg spinner Rishad gave Mendis his first ODI wicket, that too on his very first ball of the game.
Mustafizur ended Aslanka's counter-attacking innings before Mehdi exposed the tail-enders by taking two consecutive wickets.
But Liyanage held one end firmly and ensured that Sri Lanka batted for 50 overs and completed his century off 101 balls by hitting Taskin for a four over cover in the final over.
Mustafizur and Mehdi claimed 2-39 and 2-38 respectively.
Bangladesh won the first match by six wickets on Friday, while Sri Lanka won the second match by three wickets.
Both the teams will now play a two-match Test series, which will start from Friday in Sylhet.
