Bangladesh's fast bowlers destroyed the Afghan top order to leave the tourists 35-3 at lunch on the second day of the one-off Test, after the hosts suffered a first-innings collapse.
Bangladesh resumed at 362-5 but were all out for 382 in the morning at a stunned Sher-e-Bangla National Stadium in Dhaka.
Nijat Masood claimed 5-79 on debut as Afghanistan took Bangladesh's last five wickets for just nine runs.
Afghan pace bowler Yamin Ahmadzai picked up two wickets to finish with 2-39.
But Afghanistan then lost three wickets in quick succession to spoil their scintillating start to the day.
Ibrahim Zadran nicked Shoriful Islam and was out for six runs, while fellow opener Abdul Malik made 17 before falling to Ebadot Hossain, with Zakir Hasan taking a sharp low catch at third slip.
Rahmat Shah was next to fall after he holed out a catch to Taskin Ahmed at midwicket off Ebadot for nine.
Afghan skipper Hashmatullah Shahidi was unbeaten on two at the break.
The hosts showed some positive intent in the morning before they collapsed.
Mehidy Hasan Miraz was unbeaten overnight but flashed a catch to Amir Hamza at gully off Yamin to end his promising innings at 48.
Mushfiqur Rahim (47) and Taijul Islam (0) followed Mehidy in the next over, bowled by Nijat, before Yamin dismissed Taskin for two.
Nijat then bowled Shoriful Islam to complete his five-for and wrap up the Bangladesh innings in unexpectedly swift style.
Afghanistan won the only other Test between the two teams when they beat the home side by 224 runs at Chittagong in 2019.
str/sa/gle/pst