Bangladesh secured their place in the main draw of the World Twenty20 despite suffering a shock two-wicket defeat to tournament rookies Hong Kong in Chittagong.

Hong Kong secured their first-ever win over a major nation when tailender Haseeb Amjad struck a one-handed six over cover with two balls remaining.

The embarrassment could have been even more profound for Bangladesh after they had faced the real prospect of an early exit from their home tournament after being skittled for 108 in 16.3 overs.

Hong Kong needed to chase down their victory target in 13.1 overs to knock the Tigers out and book an unlikely place for Nepal in the 'Super 10' phase, alongside defending champions West Indies, India, Pakistan and Australia.

That became a distinct possibility when opener Irfan Ahmed got going, striking a quickfire 34, to have the crowd inside the Zahur Ahmed Chowdhury Stadium fearing the worst.

Star all-rounder Shakib Al Hasan (three for nine) pulled Bangladesh back into the contest, after his 34 had been the best of a wretched batting performance.

Shakib trapped Ahmed in front to prompt a top-order collapse of four for six, but the minnows pressed on for a breakthrough victory on the back of Munir Dar's 36 from 27 balls.

Dar fell with nine runs still required, but the tail reduced the ask to just one from three balls, before Amjad sealed victory.

Hong Kong spinner Nadeem Ahmed had earlier claimed four for 31 to stun Bangladesh.

The Tigers never recovered from losing Tamim Iqbal and Sabbir Rahman in the first over from Tanwir Afzal.

Shakib and Anamul Haque (26) put on 48 for the third wicket, but Bangladesh then lost seven for 23 to be bowled out early.

The hosts' paltry total suddenly catapulted Nepal into contention to progress, after they shocked Afghanistan by nine runs earlier on Thursday.

Nepalese hopes initially rested on Ahmed, who had made first-ball ducks in the first two games, and who only survived his first legitimate delivery when Al-Amin Hossain got only fingertips to a return catch.

Ahmed then thrashed 34 in 28 balls, including three sixes, to send a scare through the home side before Shakib slowed Hong Kong enough to ensure Bangladesh would go through.

Hong Kong were still 41 runs short of the target when the crucial 13.1 over mark was reached, but they pushed on to secure just the fourth win by an associate over a Test-playing nation at the World Twenty20.