Bangladesh reached 223 for six in their second innings at stumps, extending their overall lead to 329 runs with four wickets remaining.
Shanto was dismissed for 82 after a patient 191-ball innings, while Mushfiqur contributed 81 off 148 deliveries.
The visitors will look to add more runs on the fourth morning and put themselves in a strong position to push for victory.
Resuming their second innings after securing a 106-run first-innings lead, Bangladesh lost Shadman Islam for 13 early.
Tanzid Hasan scored 31 off 38 balls, but Bangladesh slipped to 53 for three when Mominul Haque (7) and Tanzid departed in quick succession.
Shanto then joined Mushfiqur to steady the innings. The pair combined for a crucial 159-run partnership for the fourth wicket, frustrating Afghanistan's bowlers and strengthening Bangladesh's position in the match.
Mushfiqur was the first to fall, caught by Shahidullah off Zia-ur-Rehman in the 66th over. Shanto followed five runs later, bowled by Qais Ahmad after facing 191 deliveries and hitting five boundaries.
Zia struck again to dismiss Hasan Mahmud for one, leaving Bangladesh at 223 for six. Litton Das remained unbeaten on five, with Mehidy Hasan Miraz yet to score at the close.
Earlier, Afghanistan were bowled out for 240 in their first innings, conceding a 106-run deficit after Bangladesh posted 346.
Captain Rahmat Shah was the standout performer for Afghanistan, scoring an unbeaten 105 off 216 balls, including 10 fours and two sixes. Abdul Malik contributed 62, while Ikram Alikhil made 32.
However, Bangladesh's bowlers kept Afghanistan from building a substantial total. Hasan Mahmud claimed five wickets for 55 runs with a hat-trick, while Ebadot Hossain took four for 56. Mehidy Hasan Miraz picked up the other wicket.
Afghanistan had resumed the day on 211 for four, with Rahmat unbeaten on 84 and Ikram on 26. The pair added eight runs before Ikram fell for 32, caught behind off Ebadot.
Hasan then ran through the lower order, taking four of the remaining five wickets to complete his five-wicket haul as Afghanistan lost their last six wickets for just 29 runs.
Bangladesh had earlier posted 346 in their first innings, built around Tanzid Hasan's 83, Shadman Islam's 67 and Litton Das's 53. Nayeem Hasan remained unbeaten on 35, while Afghanistan's Mohammad Saleem took four wickets and Yamin Ahmadzai claimed three.
With a 329-run lead and four wickets still in hand, Bangladesh are firmly in control heading into the fourth day, while Afghanistan face a daunting task to save the Test.