Shakib hit an unbeaten 70 off 45 balls to guide Bangladesh to 139/6 in 19 overs.
Shakib Al Hasan smacked an unbeaten half-century as Bangladesh ended their four-match losing streak to Afghanistan in Twenty20 internationals with a four-wicket win in their final league match of the tri-nation tournament in Chittagong on Saturday.
Shakib hit an unbeaten 70 off 45 balls to guide Bangladesh to 139/6 in 19 overs after young off-spinner Afif Hossain led the bowling effort with 2/9, helping the home side restrict Afghanistan to 138/7 in 20 overs.
In pursuit of a modest target, Bangladesh wobbled at the start as openers Liton Das (four) and Najmul Hossain (five) both fell cheaply before Shakib put on 58 runs with Mushfiqur Rahim to steady the innings. Mushfiqur made 26 off 25 balls, but not before he was dropped by substitute fielder Najib Tarakai off Mohammad Nabi on 14.
Medium pacer Karim Janat dismissed Mushfiqur in the 11th over before a floodlight disruption enabled Afghanistan's bowlers to regroup. Rashid Khan struck twice after the delay and debutant Naveen-ul-Haq also claimed a wicket as Bangladesh lost Mahmudullah (six), Sabbir Rahman (one) and Afif (two) in quick succession to slide to 104/6.
Mosaddek Hossain cut Rashid late for a brilliant boundary to ease some pressure on the home side before Shakib struck the Afghanistan skipper for a four and six in consecutive balls to take Bangladesh close.
"If you look at the last few months, we haven't been up to the mark in T20s. We're working on it. The bowlers bowled well on the wicket," Shakib said after the match. "We needed someone to bat through the innings. And luckily today it was my day," he said.
Mosaddek, who was unbeaten on 19, chipped Naveen at mid-on for two runs in the last ball of the penultimate over to complete only Bangladesh's second T20 win against Afghanistan. Naveen and Rashid claimed two wickets each for Afghanistan.
Earlier, Afif swung the momentum Bangladesh's way with his double strike in the 10th over of Afghanistan's innings after Hazratullah Zazai made 47 runs off 35 balls, putting on 75 runs with Rahmanullah Gurbaz in the opening stand.
A wicket apiece for Mohammad Saifuddin, Shafiul Islam, Shakib and Mustafizur Rahman left Afghanistan in disarray before Shafiqullah's 23 off 17 balls gave them a glimmer of hope.
Afghanistan and Bangladesh had already qualified for Tuesday's final in Dhaka after winning two of their previous three matches in a competition that also featured Zimbabwe.
"Best things are that it's happened in the group stages. We have to restart and do the basics right for the final," Rashid said.