Chasing a challenging 138-run target, Pakistan were held to the final over of the match and won on a wide off the last delivery of the match. (Agencies)
Skipper Mohammad Hafeez kept his cool to finish with a 37-ball 42 not out as Pakistan needed six off the final over bowled by Dawlat Zadran and one off the last delivery.
Hafeez hit two boundaries and a six during his knock and avoided any major hiccup against a fighting Afghan team.
Pakistan got off to a solid start with a stand of 47 between Ahmed Shehzad (35) and debutant Sharjeel Khan (18) by the eighth over.
Shehzad, who hit six boundaries during his 37-ball knock, holed out while Sharjeel miscued a drive off Mohammad Nabi in the tenth over.
Despite a tight line and length by Afghanistan's bowlers, Hafeez and Akmal kept their cool, taking Pakistan close to their victory target.
Akmal hit two sixes in his 28 off 23 balls. "I think they scored what they wanted, then bowled tight and put up a good show," said Hafeez.
"I am happy with the win but we made some mistakes and need to learn from them."
Afghan captain Mohammad Nabi conceded his team were 20-30 runs short. "But I am happy the way my team fought against a strong team like Pakistan," said Nabi, whose team has qualified for World Twenty20 which Bangladesh hosts in March-April next year.
Afghanistan, who won the toss and batted, had a poor start as they lost both their openers Mohammad Shahzad (two) and Nawroz Mangal (one) by the fifth over.
But Najibullah Zadran (38) and Nabi (15 off ten) gave solidity to the innings, adding 35 for the fourth wicket in quick time.
But once left-arm paceman Junaid Khan came on to bowl he put the brakes on the Afghanistan batting, cleaning Najibullah and Samiullah Sinwari (16) in quick succession to finish with 3-24 in his four overs.
Najibullah hit three boundaries and two well-timed sixes during his 30-ball knock.
Mirwais Ashraf made a 22-ball 28 not out with two boundaries and a six to take Afghanistan to 137-8 – their highest against a Test playing country. Afghanistan had made 136 against India at Colombo in last year's World Twenty20.
Left-arm paceman Sohail Tanvir finished with 2-11 with two of his four overs maidens.
Pakistan now play Sri Lanka in the two Twenty20 games in Dubai on Wednesday and Friday while Afghanistan take on Ireland in the final of the ICC Inter-Continental Cup in Dubai from Tuesday.
Chasing a challenging 138-run target, Pakistan were held to the final over of the match and won on a wide off the last delivery of the match.