Imrul Kayes has hit an unbeaten half-century as Bangladesh took a lead of 128 with seven second innings wickets remaining against England at stumps on the second day of the second Test on Saturday.
Kayes was on 59 not out as the hosts reached 3-152.
Mahmudullah was bowled out to debutant spinner Zafar Ansari on the last ball of the day after adding 86 for the third wicket with Kayes.
Bangladesh got a brisk start from first-innings centurion Tamim Iqbal, who hit a 47-ball 40, and Kayes who put on 65.
Earlier, Bangladesh off-spinner Mehedi Hasan picked up his second five-wicket haul of the series but a ninth-wicket stand of 99 gave England a first innings lead of 24.
England, who lead the series 1-0 and resumed on 3-50, were reduced to 8-144 in the first session but the partnership between Chris Woakes and Adil Rashid put paid to Bangladeshi hopes of a first-innings lead.
The second new ball finally bore fruit for the hosts as 19-year-old Mehedi dismissed Woakes for 46 to break the dogged stand.
Left-armer Taijul Islam took his third wicket in the following over to dismiss England for 244 and bring up tea on the second day, leaving Rashid 44 not out.
Thirteen wickets had fallen on the opening day and it did not take long on Saturday for Mehedi to send back Moeen Ali for 10 and Ben Stokes to fall for a duck off a bat-pad catch.
That left England struggling at 5-69 and the tourists were grateful to Joe Root and Jonny Bairstow for digging them out of a hole with a 45-run stand for the sixth wicket.
Bangladesh captain Mushfiqur Rahim turned to Mehedi to break the partnership and the youngster duly delivered, dismissing Bairstow leg before wicket for 24 with the first delivery of his spell.
Root, who was dropped on 19 at slip off Taijul, showed great determination and nimble footwork to bring up his 23rd half-century in Tests.

