Rashid Khan finished with 11 wickets in the match as Afghanistan made up for lost time to beat Bangladesh on a rain-hit final day of the one-off Test.
Having reached stumps the previous day on 136-6 in pursuit of an improbable victory target of 398, Bangladesh appeared set to be saved when bad weather wiped out the majority of the first two sessions on Monday.
However, the rain relented enough for 18.3 overs of play after tea - a small window of opportunity that Afghanistan immediately capitalised on with the huge wicket of Shakib Al Hasan.
The all-rounder fell to the first delivery after the resumption, a lazy cut shot seeing the left-hander caught behind off the bowling of Zahir Khan (3-59) for 44.
Rashid, who also made a half-century with the bat on day two of the contest in Chattogram, then worked his way through the lower order, the leg-spinner trapping both Mehidy Hasan and Taijul Islam lbw.
Afghanistan's captain duly wrapped up victory - just his country's second in the longest format following their success over Ireland in March - with less than four overs remaining.
Soumya Sarkar was the last man to go, caught at short leg by Ibrahim Zadran for 15, as Bangladesh were bowled out for 173 to lose by 224 runs. Rashid finished with 6-49 to follow up his figures of 5-55 in the first innings.