Mayers’ knock of 210 not-out helped the tourists reach a daunting target of 395 in Chattogram, the fifth-highest successful run chase in Test history.
Mayers added 216 runs with Nkrumah Bonner (86) to turn the match on its head and took a single off spinner Nayeem Hasan to seal a fairytale victory for a second-string West Indies side led by Kraigg Brathwaite.
Mayers, a 28-year-old left-handed batsman from Barbados, remained unbeaten on 210, including 20 fours and seven sixes, and became only the sixth player to score a double hundred in the fourth innings of a test.
West Indies sent a weakened squad to Bangladesh after several players, including test captain Jason Holder, opted out of the tour citing COVID-19 concerns.
The second and final test starts in Dhaka on Thursday.
Additional reporting by Reuters.