Pakistan skipper Babar Azam made a fluent 51 but it was Asif Ali's blistering 25 off seven balls that sealed their tense victory with six balls to spare.

Pakistan put one foot in the semi-finals of the Twenty20 World Cup after Friday's win in the tournament.
Pakistan put one foot in the semi-finals of the Twenty20 World Cup after Friday's win in the tournament. (AFP)

Asif Ali has smashed four sixes in the penultimate over to help Pakistan achieve a hard-fought five-wicket win over Afghanistan in the Twenty20 World Cup in Dubai.

With Pakistan needing 24 runs off the final two overs, Asif lifted paceman Karim Janat's first, third, fifth and sixth balls over the boundary to help Pakistan overhaul a tricky 148-run target on Friday.

Asif finished with 25 off just seven balls with four sixes and a single, leaving Janat and all the other Afghan players frustrated. 

The win gave Pakistan a third win in as many games in Group 2 of the Super 12 stages, almost assuring a semi-final place, needing just one more win from their last two games.

Afghanistan scored a fighting 147-6 in their 20 overs with Gulbadin Naib and skipper Mohammad Nabi scoring 35 each.

Skipper Babar Azam anchored Pakistan's innings with a 47-ball 51 but his dismissal – bowled by spinner Rashid Khan – turned the game on its head in the 17th over with Pakistan needing 26 off the last three overs.

Paceman Naveen-ul-Haq conceded just two runs in the 18th over and dismissed Shoaib Malik for 19 but Asif quashed all hopes of an Afghanistan win.

Pakistan's task was to handle spinners Rashid and Mujeeb Ur Rahman in their chase with the evening dew making life tough for bowlers.

Mujeeb dismissed Mohammad Rizwan (eight) while Nabi accounted for Fakhar Zaman (30) before Rashid's wickets of Mohammad Hafeez (10) and Babar.

Earlier, Gulbadin Naib and Nabi lifted Afghanistan from a wobbly start.

Naib smashed a 25-ball 35 not out while Nabi scored an undefeated 32-ball 35 as they helped Afghanistan recover from 76-6 with an unbroken seventh wicket stand of 71 after they won the toss and batted.

All six top Afghanistan batsmen were caught playing rash shots but Nabi and Naib added 54 runs in the last five overs to give their team a fighting total.

Naib hit two fours and a six off paceman Hasan Ali to take 21 off the 18th over and the pair scored 15 in the 19th bowled by Haris Rauf.

Naib's knock had four boundaries and a six while Nabi hit five boundaries.

Left-arm spinner Imad Wasim was the pick of Pakistan's bowlers with 2-25, dismissing dangerous opener Hazratullah for a five-ball duck.

Najibullah Zadran (22) and Janat (15) were other contributors.

Pakistan kept the same eleven which beat India and New Zealand in their first two matches while Afghanistan were also unchanged from their first game rout of Scotland.

READ MORE: Pakistan's T20 win against India will be remembered for generations

Source: TRTWorld and agencies