Mehidy took the three wickets to fall as West Indies set about the challenge, reaching 110-3 at the close of the fourth day in Chittagong.
After his 103 in Bangladesh’s first innings total of 430 and 4-58 when they bowled out the West Indies for 259, Mehidy needs only three more wickets to become just the fourth all-rounder to get a hundred with the bat and take 10 wickets in the same Test.
Only England great Ian Botham, former Pakistan captain Imran Khan and his star Bangladesh teammate Shakib Al Hasan have managed it so far.
Mehidy had been left out of Bangladesh’s last three Tests after a run of poor form but has overshadowed Shakib in the campaign to put pressure on West Indies.
After captain Mominul Haque completed his hundred and declared Bangladesh’s innings on 223-8, West Indies reached 110-3 at the close of the fourth day, still needing 285 for an unlikely win.
Kyle Mayers (37) and Nkrumah Bonner (15) were at the crease. Mehidy’s spin claimed Kraigg Brathwaite (20), John Campbell (23) and Shayne Moseley (12) to finish the day with 3-52.
Mominul’s 115 of 182 balls and Liton Das’s 69 put Bangladesh in control. The pair put on 133 for the sixth wicket after the home side lost Mushfiqur Rahim (18) early in the morning to Rakheem Cornwall’s bowling.
Mominul and Liton frustrated West Indies with their fluent century partnership, which ended when Liton attempted a reverse sweep and was caught by Kyle Mayers off Jomel Warrican.
Mominul brought up his hundred off 173 balls but as he sought to accelerate the scoring he was caught by Kemar Roach at deep mid-wicket to give Shannon Gabriel his second wicket.
Warrican dismissed Taijul Islam (four) and Mehidy Hasan (seven) before Bangladesh declared.
Warrican (3-57) and Cornwall (3-87) were the most effective West Indies bowlers.