Debutant Kyle Mayers made an unbeaten fourth-innings 210 to lead West Indies to the highest successful Test run chase in Asia.
Bangladesh declared in Chattogram to set the Windies a target of 395, which seemed improbable when Mayers arrived at the crease, batting at number five and joining the fray at 59-3.
But the new man, who made 40 in his first innings, joined Nkrumah Bonner to put on 216 for the next wicket and swing momentum back in the tourists' favour on Sunday.
Mayers later did the heavy lifting in another three-figure partnership with Joshua Da Silva, too, and was fittingly the man to scramble the match-winning single with 15 balls remaining in the first Test - and three wickets to spare.
His stunning display sealed the fifth-highest successful chase in the history of the format, a new benchmark in Asia and the best anywhere since 2008.
Mayers survived 310 balls in 415 minutes as he scored 20 fours and seven sixes.
"I have a few centuries in domestic cricket, but this is very special to me," the 28-year-old said.
"It's my highest score and the longest I've ever batted in first-class cricket. It's very special to me to get a double in my first Test match."
Mayers became just the sixth batsman to score a double century on his Test debut and the sixth to pass 200 in a fourth innings.
Only Mayers has combined the two and recorded a double hundred in the fourth innings of his bow in the longest format.
Mayers - with just five limited-overs internationals to his name, his highest score 40 - was driven by the team's need to break new ground on day five, although he tried not to be distracted by a scoreboard that increasingly read in the Windies' favour.
"Truly, I was not looking at the target," he said.
"I was just trying to stick to my game plan for as long as possible, try not to look at the scoreboard, try to bat as long as possible and know within myself that, if I bat the whole day, my team will come across the line.
"The hundred was on the cards for me personally, yes, but I knew the team needed me to score more than 100.
"Batting, I was always thinking of scoring 150 - I thought, at the beginning of the day, if I score 150, 160, my team will be in good stead to cross the line.
"But as I reached 160, I knew that I had to push more and it just encouraged me to go further."