England 293 and 240 (Stokes 85, Bairstow 47, Shakib 5-85) beat Bangladesh 248 and 263 (Sabbir 64*) by 22 runs
Scorecard and ball-by-ball details
Ben Stokes capped a supreme allround performance with two wickets in three balls - his fifth and sixth of the match, to go alongside his total of 103 runs - as Bangladesh's hearts were broken on the fifth and final morning of an epic Test match at Chittagong.
Resuming on 253 for 8, with 33 runs still required, Bangladesh had visions of securing only their eighth Test victory in 94 attempts, and their first against England in nine. However, a brace of lbws in the fourth over of the morning - the first reviewed in optimism by England, the second in desperation by the last man, Shafiul Islam - left their hero of the second innings, Sabbir Rahman, high and dry on 64 not out.
Facing a dilemma when play resumed, Alastair Cook showed his hand from the outset, handing Stuart Broad the first over of the morning, following on from his marathon nine-over spell on the fourth evening, and partnering him with Stokes, the man whose mastery of reverse swing had proven so illegible to Bangladesh's tail in the first innings.
But Bangladesh began their morning's work with confidence. Sabbir opened his account with a push through the covers for two, before Taijul Islam - once again trusted to hold his own with the bat - flashed a Stokes short ball over the keeper's head for four.
The new ball was available after two overs but Cook opted to persevere with the old, with the long-sleeved Joe Root once again charged to preserve its precious shine. But the hooping reverse of the first innings remained elusive as Bangladesh chiselled out their singles, every run greeted with ecstasy by a small contingent of Bangladesh fans who made an otherwise echoing stadium sound packed to the rafters.
However, Stokes' determination could not be denied, and after coming round the wicket to Taijul, he persuaded Cook to gamble one of England's two reviews - which had been topped up at the 80-over mark - as the No. 10 stepped too far across his stumps and was pinned in front of middle and leg.
The verdict was greeted with a huge roar from the huddle of England players watching the big screen, and there was an extra sense of expectation as Shafiul shuffled out to face the pumped-up Stokes. Five years ago, on this very ground, he had been Bangladesh's hero with a brilliant 24 not out in Bangladesh's two-wicket World Cup win over England. This time, however, he was trapped on the crease second-ball and, though he was struck outside the line of off stump, Kumar Dharmasena felt that he had not quite been playing a shot as he raised his finger for the final time in the game. And this time, it stayed raised, as victory was confirmed via a record 26th DRS decision of the match.
Afterwards, Cook was relieved but happy to have overseen such a tense finale to the contest. "It was a really good Test match," he said during the post-match presentations. "It was such a tight game, so credit to both sides. I'm glad we held our nerve, with the quality we have in our attack, we got it reversing."
Cook admitted that the option of turning to the new ball with his spinners would have been a "gamble", which was not a ringing endorsement of the trio at his disposal. But ultimately he was grateful to have a competitor of Stokes' quality in his ranks.
"Not just with ball in hand but the way he batted, he balances the side," he said. "Those cricketers don't come around very often and he's got an enormous heart as well. He's a seriously good cricketer."
Mushfiqur Rahim, Bangladesh's captain, put a brave face on another near-miss for his team, and credited his players for a hugely spirited performance in their first Test match since August 2015.
"Probably it was not in our favour, 33 runs and two wickets, but the boys put in so much effort over the last five days, after 15 months, I'm really proud. Our boys fought it out which is really impressive and hopefully we'll do the same in the next match."
Andrew Miller is UK editor of ESPNcricinfo. He tweets @miller_cricket