Bangladesh, sent into bat, fell to a below-par total of 108 runs all out in 16.3 overs before Hong Kong reached the target for the loss of eight wickets in 19.4 overs.
Hong Kong needed to knock off the target in 13.1 overs to oust the home team in favour of Nepal, who earlier in the day upset Afghanistan by nine runs.
Hong Kong could not achieve that and had almost lost the match before Munir Dar hit a match-turning 27-ball 36 and number nine Haseeb Amjad hit the winning six during his 12 not out.
It marks only the fourth occasion when an Associate side has beaten a full Test-playing country in a World Twenty20.
Shakib Al Hasan, who top-scored with 34, turned his left-arm over for 3-9 in his four overs, much to the joy of a capacity 18,000 fans at Zahur Ahmed Chowdhury Stadium.
Bangladesh won two of their three matches to qualify on a better net-run rate than Nepal for the next round starting from Friday.
Bangladesh join defending champions the West Indies, Pakistan, India and Australia in Group 2.
Ireland, Zimbabwe and the Netherlands compete for the second qualifying spot from Group B on Friday.
Bangladesh, sent into bat, had themselves to blame as they spurned a good chance of posting a big total, losing their last seven wickets for a mere 23 runs after being well set at 85-3 by 11th over.
It was Shakib's wicket that triggered a collapse with left-arm spinner Nadeem Ahmed taking a career best 4-21 and leg-spinner Nizakat Khan grabbing 3-19.
Hong Kong started off well with opener Irfan Ahmed hitting three towering sixes and as many boundaries in his 28-ball 34 but once he was dismissed in the eighth over made the task difficult.
Munir Dar brought Hong Kong back with three boundaries and a six.
There are two qualifying round matches in Sylhet on Friday, while arch-rivals Pakistan and India kick off the Super-10 stage in a match in Dhaka.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ