Captain Mehidy Hasan Miraz and Towhid Hridoy struck half-centuries but their dismissal in quick succession sparked a collapse that saw them lose six wickets for 67 runs as Bangladesh were dismissed for a below-par 221 in 48.5 overs.
Afghanistan struggled to some extent before reaching 226-5 in 47.1 overs for a victory to lead the series 1-0.
Afghanistan came into the game, suffering four defeats to Bangladesh in a row in T20 format but they showed well composure in chasing the target, masking their own batting problem shrewdly.
The heart of the chase was opener Rahmanullah Gurbaz and experienced middle-order batter Rahmat who made 50 each.
Azmatullah Omarzai who claimed 3-40 with the bowling, hit 44 ball-40 to utilize the platform set by the duo well.
Captain Hashmatullah Shahidi, however, sealed the deal by staying unbeaten on 33.
Bangladesh's vaunted bowling attack could do little in the face of some real stubbornness shown by Gurbaz and Rahmat who added 78 runs for the third wicket.
Gurbaz shared a 52-run stand with Ibrahim Zadran for the opening stand to start the chase solidly.
Tanvir Islam had Zadran stumped for 23 to break the opening partnership before Tanzim Hasan Sakib removed Sediqullah Atal for 5, leaving Afghanistan 58-2.
The partnership of Gurbaz and Rahmat steadied Afghanistan but Bangladesh clawed back into the contest, removing both in three balls.
Miraz got the better of Gurbaz while Tanzim got rid of another set batter Rahmat.
Shahidi then anchored the innings while Omarzai counterattacked in a display of caution and aggression to edge Afghanistan closer to victory.
Tanzim sent back Omarzai to finish with 3-31 for best bowling figure for Bangladesh before Shahidi and Mohammad Nabi guided the side home with the latter hitting a towering six to sign off the game in emphatic fashion.
Earlier, Miraz hit a team-best 60 off 87 with one four and one six while Hridoy made 56, his consecutive third fifty and fourth fifty plus in his last five ODI innings. His innings was laced with one four and three sixes.
Hridoy came into the game with a poor T20 form behind, which cost him his place in the T20 series against Afghanistan but he stood tall in the first ODI when it mattered most.
He and Miraz added 101 runs for the fourth wicket to lay a solid platform but a familiar collapse saw Bangladesh lose the last six wickets for 67 runs.
After opting to bat first, Miraz said a total around 280 might be a good total here but the top order batters couldn't justify the decision to bat first.
Afghanistan pacer Azmatullah Omarzai dealt a double strike, removing opener Tanzid Hasan Tamim for 10 and Najmul Hossain Shanto for 2, leaving Bangladesh 25-2.
Saif Hassan, who made his ODI debut, appeared to have translated his T20 form but was undone by Naangeyalia Kharote after making 26 off 37.
Miraz and Hridoy were shaky at the start as Afghanistan pacers bowled in disciplined channel.
They steered Bangladesh through the torrid period and brought up their respective half-centuries before legspinner Rahsid Khan got into the act.
Rashid dismissed both of the batters in quick succession to spark the collapse. He also took the wicket of Nurul Hasan Sohan to finish with 3-38.
Omarzai who took 3-40 and AM Ghazanfar (2-55) cleaned up the tail as Bangladesh's lower order crumbled in horrible fashion, reports BSS.