Sri Lanka have avoided being swept by Bangladesh in their one-day international series by winning the third match by 97 runs with Kusal Perera's century and Dushmantha Chameera's maiden five-for.
Perera struck a 122-ball 120, including 11 fours and one six, to lead Sri Lanka to a respectable 6-286 on Friday.
Paceman Chameera then took 5-16 to undermine Bangladesh's reply, as they were bowled out for 189 in 42.3 overs.
The victory marked Sri Lanka's first in the ODI Super League, with captain Perera feeling it was a bitter-sweet triumph as he said: "Badly needed win - but we lost the series."
"My innings, I took calculated risks in the first 10 overs. Fifty, sixty (runs) is not enough for the team, so once I got set I changed gears to try and bat long. Our bowling department did a really good job."
Perera hit a bulletproof 50 off 44 balls, but the skipper needed luck three times to reach his sixth ODI century, being dropped on 66 and 79 and also when one run away from his hundred as Mahmudullah spilled a chance off Mustafizur Rahman.
Perera finally reached the century off 99 balls with a single off Mustafizur.
Pacer Shoriful Islam, who was wayward in his first spell, came back strongly in his second spell to dismiss Perera with a back-of-length delivery.
The Bangladesh bowlers regrouped to stall Sri Lanka in the last overs, utilising the slower delivery well, though Dhananjaya de Silva escaped them with 55 not out off 70 balls.
The Bangladesh batsmen, however, struggled from the start.
Chameera grabbed opener Naim Sheikh (1), playing instead of Liton Das, and Shakib Al Hasan (4).
Skipper Tamim Iqbal then nicked Chameera's slower delivery behind to reduce the home side to 3-28 in the 10th over.
Mushfiqur Rahim, who scored 84 and 125 in the previous ODIs, played a rash shot to be out for 28, giving offspinner Ramesh Mendis his debut ODI wicket.
A 56-run stand between Mushfiqur and Mosaddek Hossain offered Bangladesh some hope, but when Mosaddek was out for 51 off 72 balls while trying to reverse-sweep Mendis, Bangladesh were all but out of the game at 5-125 in the 32nd over.
Mahmudullah batted on for 53 off 63 until he was last out.
"We won the series but we haven't played to our full potential," Tamim said.
"There are still some areas to work on. I hope we will learn from the mistakes."