Moeen Ali and Jonny Bairstow scored half-centuries each as England reached 258-7 at stumps on the first day, after skipper Alastair Cook elected to bat first at the Zahur Ahmed Chowdhury stadium.
Moeen survived five reviews on his way to smashing 68 runs and Bairstow made 52 as England steadied against some superb bowling from Bangladesh's spinners to post a respectable score.
Chris Woakes was 36 not out and Adil Rashid unbeaten on five.
Mehedi, named player of the tournament at the Under-19 World Cup earlier this year, made an immediate impression, bowling Ben Duckett for 14 before trapping Gary Ballance for one in his opening spell.
Shakib removed Cook for just four, in a disappointing start for the skipper who became England's most capped player with 134 Tests.
Mehedi opened the attack for the hosts, beating Duckett on several occasions before he spun one beautifully to hit the middle stump as soon as the England debutant offered some room.
Ballance was initially given not out lbw, but Bangladesh reviewed the decision in their favour, with the replay showing the ball had struck his pad on the back foot first before touching the bat.
Moeen was given out three times by umpire Kumar Dharmasena but his decisions were overturned on each occasion.
He was given out on 17 off Shakib before lunch -- and then twice on the same score, in the first over after the break, off the same bowler. Two separate reviews from Bangladesh also failed.
Root had looked in good touch until he edged one that took a deflection off wicketkeeper Mushfiqur Rahim's gloves before being grabbed by Sabbir Rahman at slip.
Shakib then bowled Ben Stokes (18) for his second wicket, but Bairstow joined Moeen for a 88-run sixth wicket partnership to revive England's innings.
Moeen, who hit eight fours and a six in his 170-ball knock, was finally dismissed when Mehedi beat him with a turn to induce an edge that Rahim gladly accepted.
Mehedi bowled Bairstow to complete his five-wicket haul shortly after the England wicketkeeper-batsman brought up his 11th Test fifty, a composed innings that featured eight fours.
Disclaimer: No Business Standard Journalist was involved in creation of this content
