Mayers struck 20 fours and seven sixes in his 310-ball 210 not out, guiding the West Indies to complete the fifth highest chase in a test and also the biggest in Asia.
Mayers, who scored 40 runs in the first innings, ended with 250 runs in the match, the second highest for a West Indies batsman on debut.
His 216-run partnership with Nkrumah Bonner (86) for the fourth wicket, West Indies'' highest 4th innings partnership for any wicket since 1984, proved to be the game changer.
Needing another 285 runs with seven wickets in hand, the West Indies began the crucial fifth day on the front foot, with Bonner pulling offspinner Mehidy Hasan over square leg for a boundary from the first ball.
Mayers and Bonners then survived several tricky moments in the first hour of the day, with offspinner Hasan (4-113) and left-arm spinner Taijul Islam (2-91) keeping the batsmen on their toes.
Mayers brought up his century off 177 balls, after getting an outside edge that flew past gully for his 13th boundary. In doing so, he became just the eighth batsmen to hit a fourth-innings century on debut.
While Mayers chose to counterattack, Bonner opted to defend in a strategy of caution and calculated aggression that served them well.
After two disappointing sessions, Taijul Islam finally gave Bangladesh some hope, dismissing Bonner in the first over after tea.
The wicket came off just as Bonner came out in an aggressive mood to press for victory as West Indies entered the last session needing another 129 runs from a possible 33 overs.
Bonner''s 86 came off 245 balls, with 10 boundaries and one six.
Bangladesh then appeared to tighten its grip on the match as offspinner Nayeem Hasan dismissed Jermaine Blackwood for 9, leaving the West Indies at 292-5.
But Mayers continued his spectacular attack with wicketkeeper Joshua Da Silva giving him the necessary support to seal the victory.
Silva scored just 20 in their 100-run partnership and was out just three runs away from victory.
Mayers, meanwhile, brought up his double hundred off 303 balls with a gentle punch to deep backward point for a single.
He then hit his seventh six to put the tourists on the verge of the victory before pushing one off Nayeem Hasan to mid-on for a single to confirm the victory.
On Saturday, Bangladesh declared its second innings on 223-8 after skipper Mominul Haque struck his 10th test century.
Off-spinner Mehidy Hasan then continued his good recent form for Bangladesh, taking three wickets to reduce the tourists to 110-3 at stumps on day four.
Bangladesh scored 430 in its first innings before gaining a 171-run lead after dismissing West Indies for 259 runs. (AP) ATK