Allrounder Mehidy Hasan Miraz and Najmul Hossain Shanto smashed centuries before Bangladesh's pace bowlers shared eight wickets to beat Afghanistan by 89 runs in the Asia Cup in Lahore on Sunday.
Miraz hit a 119-ball 112 for his highest ODI score while Shanto scored a 105-ball 104 to help Bangladesh to 334-5 before they bowled out Afghanistan for 245 in 44.3 overs.
Taskin Ahmed (4-44), Shoriful Islam (3-36) and Hasan Mahmud (1-61) took wickets at regular intervals to keep Bangladesh's hopes of reaching the Super Four stage alive.
Afghanistan will now play title holders Sri Lanka -- who defeated Bangladesh in their first game -- on Tuesday in Lahore to decide who qualifies for the next round.
Set to chase their highest target in ODIs, Afghanistan got off to a disastrous start with Islam trapping the dangerous Rahmanullah Gurbaz leg-before in the second over for one.
Ibrahim Zadran, who top-scored with 75, added 78 for the second wicket with Rahmat Shah (33) and another 52 for the third with Hashmatullah Shahidi (51) but failed to keep up the momentum.
Mahmud ended Zadran's 74-ball knock with a brilliant diving catch by wicketkeeper Mushfiqur Rahim to hit Afghanistan hard. He hit ten boundaries and a six.
Shahidi and Najibullah Zadran (17) added 62 for the fourth wicket to keep Afghanistan in the hunt but they fell in quick succession.
With 123 needed off the last ten overs, Rashid Khan hit a 15-ball 24 but that was too little, too late.
Bangladesh skipper Shakib Al Hasan praised Miraz.
"We played very well all-round," said Shakib. "Mehidy got his chance up the order and proved himself, we always knew he had the ability. We executed our plans really well."
Afghanistan skipper Shahidi was disappointed with his team's bowling.
"We conceded too many runs," said Shahidi. "It was still chaseable but we fell short and now our last game is do-or-die."
Earlier, Miraz and Shanto helped Bangladesh put up their highest ODI total outside their own country.
The pair lifted their team from the loss of Mohammad Naim (28) and Towhid Hridoy (0) through a third-wicket stand of 194 off 190 balls, punishing Afghanistan's spinners on a flat Gaddafi stadium pitch.
Bangladesh changed up their tactics after losing their first game, promoting right-hander Miraz up the order to open the innings.
Miraz justified the decision by striking seven boundaries before he hurt his left hand while hitting a third six and walked off the field.
Shanto hit nine boundaries and two sixes before he was run out in the 45th over as Bangladesh piled up 103 runs in the last ten overs.
Shakib carried on the good work with an 18-ball 32 not out that was laced with four boundaries and a six.
Afghanistan's much-vaunted spin trio failed to stop the flow of runs with only Mujeeb Ur Rahman getting one wicket while Rashid went wicketless in his 10 overs which cost 66 runs.
Pakistan have already qualified for the Super Fours from Group A by beating Nepal in their first match and then seeing their clash against India end in a no result due to rain in Pallekele on Saturday.