Mahmudullah kept Bangladesh in the game, sharing stands with the lower order. He was handed a chance when on 98 after Windies missed a run-out.
Mahmudullah got to his third Test century in Dhaka.
After a poor first session when Bangladesh scored at a rate in excess of 5, Windies struck in the second session with the important wicket of Liton Das to end a 92-run stand.
Mahmudullah took Windies to a solid total of 508 before they were bowled out, en route a career-best 136.
The Bangladesh spin duo of Shakib and Mehidy Hasan struck early to reduce Windies to 29/5. Hetmyer and Dowrich took them to stumps without further the damage, ending the day on 75/5.