An inspired Ben Stokes revived England with ball and bat on the third day against Bangladesh on Saturday to put the visitors firmly in control of the opening Test in Chittagong.
Stokes produced a brilliant effort to complete figures of 4-26 on a pitch largely unresponsive to pace bowling, triggering a batting collapse as Bangladesh were dismissed for 248 to give England a first-innings lead of 45.
Stokes then walked in to bat with England tottering on 46 for four in the second innings and propped up his team with a fighting 85.
At stumps, England had reached 228 for eight for an overall lead of 273. Chris Woakes (11) and Stuart Broad were unbeaten at the crease.
Scoring runs was becoming increasingly difficult on the spinning track at the Zahur Ahmed Chowdhury Stadium and England suffered early losses in their second innings.
The touring side were in dire straits at 62 for five but Stokes added 127 for the sixth wicket with Jonny Bairstow (47), hitting six fours and three sixes before he fell lbw to Shakib Al Hasan.
Left-arm spinner Shakib (5-79) picked up his 15th five-wicket haul in Tests, making amends for playing a rash shot to get out in the morning.
Shakib (31) also claimed the wickets of Ben Duckett, Joe Root, Moeen Ali and Adil Rashid.
Earlier, the hosts looked as if they would get their noses in front when they resumed on 221 for five but England needed just over an hour to bundle them out.
Shakib danced out to Moeen's off-spin on the second delivery of the day but was nowhere near the ball and was stumped by yards.
Stokes swung the ball, adding the wickets of debutant Sabbir Rahman, Mehedi and Kamrul Islam to his tally.
Moeen finished with 3-75 as Bangladesh lost their last six wickets for 27 runs.
England 1st innings: 293 (M. Ali 68, J. Bairstow 52; M. Hasan 6-80)
Bangladesh 1st innings (Overnight: 221-5)
T. Iqbal c Bairstow b Batty 78
I. Kayes b Ali 21
M. Haque c Stokes b Ali 0
Mahmudullah c Root b Rashid 38
M. Rahim c Bairstow b Stokes 48
S. Al Hasan st Bairstow b Ali 31
Sh. Islam c Broad b Rashid 2
Sa. Rahman c Cook b Stokes 19
M. Hasan lbw b Stokes 1
T. Islam not out 3
K. Rabbi b Stokes 0
Extras (b-2 lb-4 w-1) 7
Total (all out, 86 overs) 248
Fall of wickets: 1-29 I. Kayes,2-29 M. Haque,3-119 Mahmudullah,4-163 T. Iqbal,5-221 M. Rahim,6-221 S. Al Hasan,7-238 Sh. Islam,8-239 M. Hasan,9-248 Sa. Rahman,10-248 K. Rabbi
S. Broad 8 - 2 - 12 - 0
G. Batty 17 - 1 - 51 - 1
C. Woakes 7 - 2 - 15 - 0(w-1)
A. Rashid 16 - 1 - 58 - 2
M. Ali 22 - 4 - 75 - 3
B. Stokes 14 - 5 - 26 - 4
J. Root 2 - 0 - 5 - 0
England 2nd innings
A. Cook c Mahmudullah b M. Hasan 12
B. Duckett c M. Haque b Al Hasan 15
J. Root lbw b Al Hasan 1
G. Ballance c Kayes b T. Islam 9
M. Ali c Rahim b Al Hasan 14
B. Stokes lbw b Al Hasan 85
J. Bairstow b Rabbi 47
C. Woakes not out 11
A. Rashid lbw b Al Hasan 9
S. Broad not out 10
Extras (b-2 lb-8 pen-5) 15
Total (for 8 wickets, 76 overs) 228
Fall of wickets: 1-26 A. Cook,2-27 J. Root,3-28 B. Duckett,4-46 G. Ballance,5-62 M. Ali,6-189 J. Bairstow,7-197 B. Stokes,8-213 A. Rashid
M. Hasan 18 - 1 - 54 - 1
S. Al Hasan 31 - 7 - 79 - 5
T. Islam 15 - 2 - 40 - 1
K. Rabbi 8 - 0 - 24 - 1
Mahmudullah 1 - 0 - 6 - 0
Sh. Islam 3 - 0 - 10 - 0