Mehidy took 5-82 and Shakib 4-82 and Zimbabwe suddenly plummeted in its first innings on day three at Harare Sports Club.
Bangladesh moved to 45 for no wicket at stumps in its second innings and led the test by 273 runs with 10 wickets in hand after posting 468 all out batting first.
Zimbabwe opener Takudzwanashe Kaitano made 87 on debut and captain Brendan Taylor 81, and their 115-run partnership for the second wicket had the home team well set.
Mehidy removed Taylor to start the slide and Zimbabwe lost its last eight wickets for 51 runs.
Bangladesh’s batsmen also produced a sudden turnaround in their first innings. Mahmudullah made 150 not out at No. 8 as Bangladesh’s tailenders piled on the runs to go from 132-6 to 468 all out.
Wicketkeeper Liton Das made 95 and No. 10 Taskin Ahmed hit 75 to erase Zimbabwe’s promising start.