Ben Duckett gave England a solid start with his maiden Test fifty.
Ben Stokes was Shakib's first of three victims in an over that put Bangladesh on the verge of a historic win.
Alastair Cook helped himself to his maiden fifty in the Test series but couldn't save England from an embarrassing defeat.
Bangladesh celebrates taking the final wicket of Steven Finn to win the second Test match between Bangladesh and England at Sher-e-Bangla National Cricket Stadium on October 30, 2016 in Dhaka, Bangladesh.
Shakib Al Hasan picked three wickets in an over to clean up the England tail.
Mehedi Hasan registered his third five-for, in four innings of Tests that he has played so far, to help Bangladesh make a comeback in the post-Tea session.
Zafar Ansari played out the hattrick ball from Shakib but fell off the very next delivery.
England captain Alastair Cook and Bangladesh captain Mushfiqur Rahim share the series trophy after day three of the second Test match between Bangladesh and England at Sher-e-Bangla National Cricket Stadium on October 30, 2016 in Dhaka, Bangladesh.
Imrul Kayes got a life early on Day 3 but couldn't convert it into a hundred. He was dismissed for 78 by Moeen Ali.
England kept Bangladesh to 296 in their second innings.
The sizeable crowd that showed up at Shere Bangla stadium witness a historic 108-run win.
Shakib Al Hasan celebrated in a unique way after dismissing Ben Stokes on 25.