Bangladesh, chasing a rain-revised target of 183 off 27 overs, won the day-night match with six balls to spare in Pallekele to register their fourth one-day victory against Sri Lanka in 33 matches.
The second game was abandoned due to heavy rain, the series was to be decided in Pallekele and Sri Lanka looked set for victory after amassing a score of 9-302 from their 50 overs.
But after a long rain interruption, Bangladesh were set a revised target of 183 runs from 27 overs to win.
Sri Lanka won the first one-day by eight wickets in Hambantota, while the second match at the same venue was abandoned due to rain.
Bangladesh complete their five-week tour of Sri Lanka on Sunday when they take on the hosts in a one-off Twenty20 international at the same venue.