On the back of their late batting pyrotechnics, Afghanistan scored 97 runs from the final 10 overs and that made the difference in the fate of the match which, however, was rendered inconsequential as both sides have already made it to the Super Four stage from Group B.
Later, Rashid showed why he is considered a premier leg spinner in the world by taking two crucial wickets, that of Shakib Al Hasan and Mahmudullah, the two most experienced players in the Bangladesh side in the absence of the likes of previous match centurion Mushfiqur Rahim.
Shakib Al Hasan (32) and Mahmudullah (27) were the top-scorers for Bangladesh and Rashid claimed their wickets with two gems of deliveries to break the backbone of their run chase. Bangladesh eventually were all out for just 119 in 42.1 overs.
Afghanistan will enter the Super Four stage with confidence after having won both their group matches. They play Pakistan in the same venue on Friday.
Chasing 256 for a win on a slow surface, Bangladesh struggled from the very beginning with two wickets falling inside five overs and runs hard to come by.
Nazmul Hossain Shanto (7), who made ODI debut Thursday, offered a leading edge to point fielder Aftab Alam of the bowling of off-spinner Mujeeb Ur Rahman in the fourth over. The next over, pacer Aftab Alam trapped Liton Das (6) LBW with an inswing delivery to reduce Bangladesh to 17 for 2.
Alam and Rahman bowled superbly with a tight line and length. The runs were hard to come by for the Bangladesh batsmen, including experienced Shakib who decided to play a waiting game in view of the precarious situation his team was in.
At the end of 10 overs, Bangladesh were 31 for 2 and it looked like an uphill task to even go near the target. The first boundary for Bangladesh came in the 15th over, and that happened after another senior player Mahmudullah came in. Shakib and Mahmudullah tried to build the innings as they grafted for runs.
In fact, the whole of the Bangladesh innings had just five boundaries. Rashid was introduced in the 22nd over and soon he broke the partnership of Shakib and Mahmudullah in his second over itself. A flat and quick delivery and Shakib was late to bring his bat down and the ball skidded off to hit on the pad right in front of the middle stump.
When Shakib, who did not hit a single boundary in his 55-ball 32, was out, Bangladesh were 79 for 5 then and staring at a defeat.
Earlier, Rashid smashed a superb unbeaten half century and shared 95 runs with Gulbadin Naib for the unconquered eighth wicket as Afghanistan made a stunning fightback to post a competitive 255 for 7.
Opting to bat, Afghanistan were initially struggling against a disciplined Bangladesh bowling attack led by veteran left-arm spinner Shakib, who grabbed four wickets for 42 runs, but Rashid (57 not out) and Gulbadin (42 not out) turned the tables in the final 10 overs.
The duo added 97 runs in the final 10 overs with a flurry of boundaries which undid all the earlier good work by the Bangladeshi bowlers. They came together in the 41st over at 160 for 7 and remained unconquered till the end.
Rashid, one of the premier leg-spinners in the world, played the role of the batting anchor for his side Thursday as he hit eight fours and one six in his 32-ball unbeaten innings. Gulbadin faced 38 balls and hit five fours.
Rashid hit four boundaries in the final over bowled by Bangladesh captain Mashrafe Mortaza to end the innings in style with a four.
Hashmatullah Shahidi had kept the Afghans in the hunt with a fighting 92-ball 58 after his side were reduced to 28 for 2 in the sixth over itself. Wickets fell around Shahidi with only opener Mohammad Shahzad (37), with whom he stitched 51 runs for the third wicket, making some contribution.
Afghanistan crossed the 100 mark exactly at the halfway stage but Shakib was only getting better as he bowled out Afghanistan captain Asghar Afghan (8) who was beaten by the flight of the delivery and drove the wrong line to see his stumps uprooted. Shakib then added another wicket to his kitty in the 34th over by having Samiullah Shenwari (18) to reduce Afghanistan to 239 for 5.
Shahidi was holding one end together all these while but he was also out in the 38th over as he edged a Rubel Hossain delivery to the wicketkeeper for a soft dismissal.
At 160 for 7 in the 41st over, it seemed that Afghanistan would struggle to even reach 200 but Rashid and Gulbadin had other ideas.