CHITTAGONG  - Ice cool skipper Alastair Cook insisted he never doubted England would hold their nerve after just preventing Bangladesh from pulling off an historic victory in a nail-biting first Test in Chittagong Monday.

Ben Stokes took the last two wickets in three balls as England sneaked home by 22 runs in a match that ebbed and flowed throughout before the dramatic 20-minute conclusion on the morning of the fifth and final day. Bangladesh had started the day needing just 33 runs for what would have been their first win over England in nine attempts.

But they added just 10 runs to their overnight total and were all out for 263 after 20 minutes of play at the Zahur Ahmed Chowdhury stadium, with Stokes cleaning up the tail with the help of the televised review system. Taijul Islam was the first to go, adjudged lbw for 16 after England appealed against umpire Kumar Dharmasena's original not out verdict.

Two balls later, Dharamsena declared the number 11 batsman Shafiul Islam out lbw for a duck -- a decision that was confirmed by TV replays after Bangladesh had appealed to the third umpire. It was a heartbreaking end for Bangladesh to a Test in which they took England right to the wire, disappointing the hopes of millions of cricket fans who had been anticipating a famous victory.

But speaking to reporters after the match, Cook -- who is famous for never breaking a sweat -- said he had found it easy to remain cool in what he acknowledged had been a "brilliant Test". "I was fairly confident this morning if I'm brutally honest," said Cook who had flown back to Bangladesh only days after attending the birth of his daughter back home. I thought we'd create the chances, the doubt was whether we were good enough to take those chances. They might be half chances. But I thought we'd create enough to win the game so I was fairly relaxed."

The match was Bangladesh's first Test in nearly in 15 months but showcased how the one-time whipping boys of international cricket have made steady progress in recent years.

The hosts played some impressive cricket during the match, with the teenage debutant Mehedi Hasan taking six for 80 in England's first innings.

Bangladesh had appeared on course for a comfortable first-innings lead but lost their last six wickets for just 27 to give England a crucial 45-run lead. They then had England reeling at 52 for five in the tourists' second innings before Stokes and Jonny Bairstow turned the match with a partnership of 127 for the sixth wicket.

Bangladesh's victory target appeared to be way beyond them at the outset but all of their main batsman made a contribution and Sabbir Rahman top-scored with an unbeaten 64 before running out of partners. Despite coming agonisingly close to what would have been their most famous Test victory, Bangladesh captain Mushfiqur Rahim said he was proud of his team's performance.

"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," Rahim said. Our boys fought it out which is really impressive and hopefully we'll do the same in the next match."

Stokes was named man of the match for taking a combined total of six wickets in both of Bangladesh's innings and also scoring a swashbuckling 85 in England's second innings which included six fours and three sixes. The second and final Test will start in Dhaka on October 28 before England then head to India for a five-Test tour.

Scoreboard

ENGLAND 1ST INNINGS: 293

BANGLADESH 1ST INNINGS: 248

ENGLAND 2ND INNINGS: 240

BANGLADESH 2ND INNINGS:

(OVERNIGHT: 253-8):

Tamim Iqbal c Ballance b Ali 9

Imrul Kayes c Root b Rashid 43

Mominul Haque lbw b Batty 27

Mahmudullah lbw b Batty 17

Shakib Al c Bairstow b Ali 24

Mushfiqur c Ballance b Batty 39

Sabbir Rahman not out 64

Mehedi Hasan lbw b Broad 1

Kamrul Islam c Ballance Broad 0

Taijul Islam lbw b Stokes 16

Shafiul Islam lbw b Stokes 0

EXTRAS: (b9, lb 13 w1) 23

TOTAL: (all out, 81.3 overs) 263

FOW: 1-35, 2-81, 3-103, 4-108, 5-140, 6-227, 7-234, 8-238, 9-263, 10-263.

BOWLING: Batty 17-3-65-3, Ali 14-2-60-2, Woakes 7-3-10-0, Rashid 17-2-55-1, Broad 15-4-31-2, Stokes 11.3-3-20-2.

TOSS: England

UMPIRES: Kumar Dharmasena (SRI) and Chris Gaffaney (NZL)

TV UMPIRE: Sundaram Ravi (IND)

MATCH REFEREE: Ranjan Madugalle (SRI)