Having bowled Sri Lanka out for 214, Bangladesh survived a mid-innings crisis that resulted in three run-outs before Jaker Ali hit the winning boundary off seamer Lahiru Kumara.
Bangladesh captain Mehidy Hasan followed his three-wicket haul with a top-score of 53 and was later adjudged the player of the match.
Nazmul Hossain made 40 and Jaker, who was forced to retire with cramps, returned to the crease and remained unbeaten on 31.
In Sunday’s final, three-time champion India will clash with the West Indies in Mirpur.
Sri Lanka, beaten by India in the semi-final, made a sound start as openers Kamindu Mendis (26) and Salindu Ushan (34) put on 60 for the first wicket in 12 overs.
But Bangladesh hit back to grab three wickets in the space of 10 runs before skipper Charith Asalanka and Wanidu Hasaranga revived the innings with a 55-run stand for the sixth wicket.
Hasaranga fell for 30 while Asalanka was ninth out after top-scoring with 76 with the help of six boundaries and a six.
Off-spinner Mehidy finished with three for 28. Mohammad Saifuddin and Abdul Haleem picked up two wickets each.
Bangladesh, looking to bounce back after the semi-final loss to the West Indies, lost opener Zakir Hasan in the first over bowled by Asitha Fernando.
The home team’s run-chase was hampered by the run-outs of their two main batsmen, Mehidy and Nazmul, before all-rounder Saifuddin also fell in similar fashion.
Needing 15 off the last two overs, Bangladesh took 11 runs in Fernando’s penultimate over to ease the pressure before Jaker and Mehedi Rana carried their team past the victory target.
Mehidy said the run-outs worried him, but was delighted his team won in the end.
“We could have done without those run-outs,” said the Bangladesh captain. “But now I am really happy. It is a good achievement for us to finish in the top three of a world event.
“We leave the tournament with very happy memories. There was obviously a lot of pressure on us because we were playing at home and our supporters expected us to go far.
“I am very proud of my team. I am sure the players have a very bright future ahead of them.”
Sri Lanka’s Asalanka blamed the defeat on yet another batting failure.
“I am really disappointed because we came here to become champions and could only finish fourth,” he said. “We have not batted well in several matches and today again we fell about 20 runs short.
“But we had some good wins in the tournament, especially the quarter-final against England when we won by six wickets. But overall, we should have played better.”
3rd/4th place play-off - Bangladesh beat Sri Lanka by three wickets in Fatullah
Sri Lanka 214 all out, 48.5 overs (Charith Asalanka 76, Salindu Ushan 34, Wanidu Hasaranga 30; Mehidy Hasan 3-28, Mohammad Saifuddin 2-48, Abdul Haleem 2-26)
Bangladesh 218-7, 49.3 overs (Mehidy Hasan 53, Nazmul Hossain 40, Jaker Ali 27 not out; Shammu Ashan 2-39)
14 Feb - Final - India v West Indies, Mirpur