Bangladeshi allrounder Shakib Al Hasan followed his four wickets with a fighting 97 to delay West Indies' likely win in the second and final Test in Khulna on Saturday.
The 25-year-old left-hander missed his third Test hundred by a mere three runs but carried the home team from a precarious 82-5 to 226-6 at close on the fourth day, still needing 35 to avoid an innings defeat.
Shakib fell off the first ball of the penultimate over of the day, miscuing a lofted shot off left-arm spinner Veerasammy Permaul and was caught at mid-off for a simple catch to Tino Best.
Shakib added a new Bangladesh versus the West Indies record of 144 for the sixth wicket with Nasir Hossain who supplemented the fight with an aggressive 64 not out.
Bangladesh first innings 387
West Indies first innings (o'night 564-4)
C Gayle c Rahim b Gazi 25
K Powell c Shakib b Rubel 13
D Bravo lbw b Gazi 127
M Samuels c sub b Rubel 260
S Chanderpaul not out 150
D Ramdin c Rahim b Shakib 31
D Sammy c Mahmudullah b Shakib 0
V Permaul c Gazi b Shakib 13
S Narine c Shahriar b Shakib 0
F Edwards c Shakib b Gazi 2
Total (eight wickets, 200.3 overs) 648
Fall of wickets: 1-37 2-43 3-369 4-546 5-621 6-621 7-639 8-639 9-648
Bangladesh second innings
T Iqbal b Best 28
N lbw b Edwards 0
S Nafees c Sammy b Best 21
N Islam b Best 2
S Al Hasan c Best b Permaul 97
M Rahim b Permaul 10
N Hossain not out 64
Total (six wickets; 56.1 overs) 226
To bat: Mahmudullah, Sohag Gazi, Abul Hasan, Rubel Hossain
Fall of wickets: 1-1 2-49 3-51 4-62 5-82 6-226
Paceman Best (3-26) had put the West Indies on course for an innings victory with a triple strike in the post lunch session but Shakib and Nasir ensured Bangladesh do not go down without a fight.
Best had opener Tamim Iqbal (28) with the first ball of his first over, then rattled Naeem Islam's stump with a sharp incoming delivery with his fourth ball before dismissing Shahriar Nafees (21) in his third over.
Bangladesh were off to a disastrous start when opener Nazimuddin was trapped leg-before for nought off paceman Fidel Edwards's third ball of the innings.
Iqbal and Nafees took the score to 49 with the help of eight boundaries between them before Best was introduced.
Captain Mushfiqur Rahim was bowled for ten by Permaul who took 2-51.
Shakib and Nasir then batted with confidence, improving the previous best sixth wicket stand of 87 against the West Indies, between Rahim and Nasir in the first innings here.
Earlier, Shakib became only the second Bangladeshi bowler to complete 100 wickets in Test cricket as he dismissed four batsmen in the morning session before the tourists declared on 648-9 after resuming at 564-4.
West Indian batsman Shivnarine Chanderpaul remained unbeaten on a brilliant 150. The experienced left-hander held the innings, hitting 12 fours and a six off 282 balls. He also hit 203 not out in the first Test.
It was the West Indies's highest total in a Test against Bangladesh, improving on the 559-4 declared they managed at Kingston eight years ago.
Shakib had Denesh Ramdin caught behind off a wild shot for 31 and then two balls later forced an edge off Darren Sammy which was well caught by Mohammad Mahmudullah in the slips to complete his 100 Test wickets.
He then removed Permaul (13) and Sunil Narine in the last over before lunch to finish with 4-151.
Left-arm spinner Mohammad Rafique was the only other Bangladeshi bowler to get 100 wickets in Test cricket.