Bangladesh fight back to set up fascinating finale against South Africa
Bangladesh were 283 for seven in their second innings when bad light brought play to a premature close at the Sher-e-Bangla National Cricket Stadium, leading South Africa by 81 runs with three wickets in hand.
Mehidy and Nayeem Hasan (16 not out) will resume on Thursday, looking to set South Africa an imposing target on a variable pitch.
Bangladesh, who were 202 runs behind the visitors after the first innings, looked headed for an innings defeat when they lost three early wickets on Wednesday, slumping from their overnight score of 101-3 to 112-6 as Kagiso Rabada grabbed two scalps and Keshav Maharaj claimed the wicket of Litton Das.
Rabada had opener Mahmudul Hasan Joy caught for 40 at first slip in the fifth over of the day and then two balls later clean bowled Mushfiqur Rahim.
Litton Das was caught behind by wicketkeeper Kyle Verreynne off Maharaj but the original appeal was turned down. South Africa captain Aiden Markram almost ran out of time before requesting a review, which proved successful.
Mehidy and debutant Jaker Ali then offered stiff resistance with an aggressive approach and put on a 138-run partnership for the seventh wicket to see off Bangladesh's deficit and offer their side hope of a turnabout in fortunes.
Mehidy brought up his half century in 94 balls, followed by Jaker, who took 104 balls to get to 50. He was then snagged leg before wicket to Maharaj for 58.
Rain halted play as South Africa were about to be offered the second new ball and tea taken early. When they returned after a lengthy delay, the umpires said the light was not good enough for South Africa to use their seamers.
Surprisingly, the visitors continued with a spin attack, instead of taking the bad light, allowing Bangladesh to add 16 runs in five overs before play was called off.
The Test in Dhaka is the first of a two-match series with the second in Chittagong next week.