Cook's side will now move on to a five-Test series against India with serious question marks over their ability to play in subcontinent conditions.
Off-spinner Mehedi took six wickets for the second time in the test as the hosts tied up the series at 1-1.
What was particularly galling was England's batting collapse, losing 10 wickets in a session as they imploded from 100 without loss before tea on the third day to 164 all out in pursuit of a victory target of 273.
Stunning success: Bangladesh's Mehedi Hasan Miraz, right, and teammate Taijul Islam celebrate a first-ever Test victory over England.
England must now regroup ahead of their five-match Test series with India, which gets underway on November 9.
"We possibly showed our inexperience in those conditions - it was awesome the difference before tea and after tea", Cook said.
Woman in S. Korea scandal meets with prosecutors
Ms Choi is the daughter of shadowy religious cult leader, Choi Tae-min, who was Ms Park's mentor until his death in 1994. Opposition parties have demanded a thorough investigation, but have not raised the possibility of impeaching her.
"It was the consistency of their length, the young guy that took all the wickets, one of his pluses was how accurate he was, whereas at times we'd bowl a couple of good balls and then we'd let the pressure off with a half-tracker or a half-volley or a ball down the leg side".
"We're not hiding behind the fact that we haven't got world-class spinners", Cook rued. The preparation gleaned from two tough Test matches against the Bangladeshis may stand Alastair Cook's men in good stead and Bayliss certainly hopes it will, as long as they can learn their lessons as they have in the past. You've got to reverse it or skid it or spin the ball.
Hussain added: "It is a sad indictment of where we are and the England captain is left scratching his head in the field because he is getting neither control nor wicket-taking potential from his slow bowlers..."
Ben Stokes, the England cricket team allrounder, was fined 15 percent of his match fee and was also handed one demerit point for breaching the International Cricket Council (ICC) Code of Conduct during the second Test against Bangladesh in Mirpur on Sunday (October 30). I try my best with this group of players who give everything to the cause. "It is a very big achievement in Bangladesh's Test cricket history".
With the England spinners being out-bowled by their Bangladesh counterparts, Cook has no qualms in accepting that his side will travel to India as "heavy underdogs".
"The boys have been training very hard since we've been here, it's been a fairly hectic two or three weeks, so I think part of it will be mental and physical rest so that we're fresh going into those matches", said Bayliss. So it's not all about just practice, practice, practice, even though people might think that's what we need to do.