DHAKA: Bangladesh qualified for the final of the Asia Cup after beating Pakistan by five wickets on Wednesday.

Pakistan recovered from 28-4 to post 129-7, before Bangladesh reached a winning total of 131-5 in 19.1 overs. Mahmudullah secured victory, and a place in Sunday's final against India, with a deep mid-wicket boundary.

Mahmudullah was unbeaten on 22, but Soumya Sarkar (48) provided the platform for the victory.

Pakistan fast bowler Mohammad Amir had figures 2-26 and kept his side's hopes alive until Mashrafe Mortaza (12 not out) hit him for two consecutive boundaries in the 18th over.

Those two boundaries off a searing yorker and a bouncer came after Shakib Al Hasan perished to a reverse sweep shot, piling the pressure on Pakistan.

With 18 runs needed in the last two overs, fast bowler Mohammad Sami conceded two no-balls, one of which Mahmudullah cut past the point to hit the boundary. It left Bangladesh needing just three runs to win in the last over.

Mahmudullah, who was at the crease during Bangladesh's two-run defeat by Pakistan in the 2012 Asia Cup final, then hit a boundary to the wild delight of the home crowd.

However, Sarkar's run-a-ball 48 against a high-quality Pakistan attack, despite losing Tamim Iqbal for seven and in-form Sabbir Rahman for 14, was the key to Bangladesh's success.

Earlier, Sarfraz Ahmed led Pakistan's recovery with an unbeaten 58. He and Shoaib Malik, who scored 41, combined in a 70-run partnership for the fifth wicket.

Electing to bat first, Pakistan was 28-4 after 10 overs, before the duo counterattacked to give the bowlers a decent total to defend.

Bangladesh fast bowler Al-Amin Hossain claimed 3-25 and caused the early damage for Pakistan, helped by his new-ball partner Taskin Ahmed, 1-14.

Left-arm spinner Arafat Sunny finished with 2-35.