Shakib’s 51 laid the foundations for Bangladesh to score 262-7 and made him the leading run-scorer in this year’s World Cup.
The 32-year-old then ripped through the Afghan batting line-up with his career-best ODI figures of 5-29 from 10 overs.
Shakib is only the second player in World Cup history to take five wickets and hit a 50 in the same match after India’s Yuvraj Singh against Ireland in 2011.
Bangladesh, winners against South Africa and the West Indies earlier in the tournament, are up to fifth place in the 10-team group stage.
They sit one point behind fourth-placed England, who face Australia on Tuesday, in the race to seal a semi-final berth via a top-four finish.
Mashrafe Mortaza’s side play India and Pakistan in their final two group matches.
Afghanistan became the first team to be eliminated after an agonising 11-run loss against India on Saturday, when Mohammed Shami’s final-over hat-trick denied them a famous upset.
Gulbadin Naib’s team have lost all seven of their matches, leaving with two games to avoid finishing the tournament without a single point.
Rahmat Shah and Gulbadin put on 49 for the first wicket, giving Afghanistan hope of a surprise win.
But Shakib’s introduction brought the breakthrough as the spinner weaved his magic.
Rahmat carelessly flicked a flatter delivery to Tamim Iqbal at mid-on and departed for 24.
Just 10 runs came from the next five overs and Hashmatullah Shahidi perished when he tried to accelerate, stumped by Mushfiqur Rahim off Mosaddek Hossain for 11.
Bangladesh had victory in their sights after Shakib took two wickets in the space of four balls.
Gulbadin was removed for 47 after driving low to Liton Das at short extra cover before Mohammad Nabi was bowled through the gate for a duck.
Shakib became the first Bangladesh player to take five wickets in the World Cup when he had Najibullah Zadran stumped.
Earlier, Shakib became the leading run scorer in this year’s World Cup so far as his side posted a solid score after being put into bat.
Shakib’s 51 took him to 476 runs in the tournament, while Mushfiqur top-scored with 83 from 87 balls.
– Aggressive hitting –
Liton was promoted ahead of Soumya Sarkar to open along with Tamim for Bangladesh, with the pair managing a brisk 23 from the first four overs.
But Liton fell for 16 in the next over after being fooled into a miscued drive by spinner Mujeeb Ur Rahman, who finished with 3-39.
That brought Shakib to the crease and he upped the tempo even further with some aggressive hitting that maintained his fine World Cup form.
When Shakib, who has two centuries already in the tournament, pulled Naib to the boundary, it moved him above Australia’s David Warner’s 447 runs.
Tamim and Shakib put on their fourth successive fifty partnership in one-day internationals.
Shakib went on to become only the second player to hit six consecutive 40-plus scores in a World Cup.
Not long after that milestone, Shakib brought up his half-century in 66 balls — his fifth score of 50 or more in this tournament — to huge cheers from the Bangladesh fans who made up the majority of the crowd.
Shakib was unable to turn his solid start into another century, but he would contribute more than enough with the ball to seal the victory.
|Liton Das||c Hashmatullah Shahidi b Mujeeb Ur Rahman||16||17||2||0||94.12|
|Tamim Iqbal||b Mohammad Nabi||36||53||4||0||67.92|
|Shakib Al Hasan (vc)||lbw b Mujeeb Ur Rahman||51||69||1||0||73.91|
|Mushfiqur Rahim||c Mohammad Nabi b Dawlat Zadran||83||87||4||1||95.40|
|Soumya Sarkar||lbw b Mujeeb Ur Rahman||3||10||0||0||30.00|
|Mahmudullah||c Mohammad Nabi b Gulbadin Naib||27||38||2||0||71.05|
|Mosaddek Hossain||b Gulbadin Naib||35||24||4||0||145.83|
|Mohammad Saifuddin||not out||2||2||0||0||100.00|
|Extras||9 (b 0 , lb 0 , nb 0, w 9, pen 0)|
|Total||262/7 (50 Overs, RR: 5.24)|
|Fall of Wickets||1-23 (4.2) Liton Das, 2-82 (16.6) Tamim Iqbal, 3-143 (29.2) Shakib Al Hasan (vc), 4-151 (31.6) Soumya Sarkar, 5-207 (42.6) Mahmudullah, 6-251 (48.3) Mushfiqur Rahim, 7-262 (49.6) Mosaddek Hossain,|
|Mujeeb Ur Rahman||10||0||39||3||3.90|
|Gulbadin Naib||c Liton Das b Shakib Al Hasan (vc)||47||75||3||0||62.67|
|Rahmat Shah||c Tamim Iqbal b Shakib Al Hasan (vc)||24||35||3||0||68.57|
|Hashmatullah Shahidi||st Mushfiqur Rahim b Shakib Al Hasan (vc)||11||31||0||0||35.48|
|Asghar Afghan||c Sabbir Rahaman b Mosaddek Hossain||20||38||1||0||52.63|
|Mohammad Nabi||b Shakib Al Hasan (vc)||0||2||0||0||0.00|
|Samiullah Shinwari||not out||49||51||3||1||96.08|
|Ikram Alikhil||run out (Liton Das)||11||12||1||0||91.67|
|Najibullah Zadran||st Mushfiqur Rahim b Shakib Al Hasan (vc)||23||23||2||0||100.00|
|Rashid Khan||c Mashrafe Mortaza b Mustafizur Rahman||2||3||0||0||66.67|
|Dawlat Zadran||c Mushfiqur Rahim b Mustafizur Rahman||0||8||0||0||0.00|
|Mujeeb Ur Rahman||b Mohammad Saifuddin||0||4||0||0||0.00|
|Extras||13 (b 1 , lb 6 , nb 0, w 6, pen 0)|
|Total||200/10 (47 Overs, RR: 4.26)|
|Fall of Wickets||1-49 (10.5) Rahmat Shah, 2-79 (20.5) Hashmatullah Shahidi, 3-104 (28.1) Gulbadin Naib, 4-104 (28.3) Mohammad Nabi, 5-117 (32.2) Asghar Afghan, 6-132 (35.1) Ikram Alikhil, 7-188 (42.4) Najibullah Zadran, 8-191 (43.3) Rashid Khan, 9-195 (45.4) Dawlat Zadran, 10-200 (46.6) Mujeeb Ur Rahman,|
|Shakib Al Hasan (vc)||10||1||29||5||2.90|
|Mehidy Hasan Miraz||8||0||37||0||4.62|