Samuels's 126 anchored the chase as West Indies reached 228 with three overs in hand after their spinners, led by Sunil Narine (4-37), had restricted Bangladesh to 227 runs in 49.1 overs.
The visitors trail the five-match series 2-1.
West Indies lost opener Chris Gayle for four but Samuels steadied the innings thanks to a 111-run second-wicket stand with Kieran Powell (47) who had replaced out of form Lendl Simmons for the game.
Mahmudullah broke the dogged partnership when he dragged Powell out of his crease for Mushfiqur Rahim to complete the stumping and put Bangladesh back in the contest.
Off-spinner Sohag Gazi got rid of Darren Bravo for 13 before Abdur Razzak took the wickets of Dwayne Smith (4) and Kieran Pollard (1), leaving West Indies extremely nervous.
But Samuels survived somehow to ensure West Indies did not throw the match away and his 149-ball innings included 17 fours and two sixes.
The right-hander, however, lived dangerously. Rahim dropped an edge off Mahmudullah on 61 before Mashrafe Mortaza grassed a simple catch at slip with Samuels on 96.
When Mortaza got him out finally, the match was all but over with West Indies needing just six runs.
Narine earlier made the most out of the turning wicket to derail Bangladesh's top order after Tamim Iqbal and Anamul Haque gave the home side a positive start with a 57-run opening stand.
Narine took Tamim (22) and then Naeem Islam (4) in one over before he had Anamul for 33.
Debutant Veerasammy Permaul then removed Nasir Hossain and Gayle join the attack to send back Mominul Haque (12) as Bangladesh reached 110-5.
Mushfiqur and Mahmudullah rescued the hosts from an embarrassing total but the batting powerplay did the damage.
Bangladesh could add just 14 runs in five overs of powerplay and lost the wicket of Mushfiqur (38) and Mashrafe in the process.
Mahmudullah, who was out for 52, and Gazi (30) provided some late resistance to give the Tigers a total from where they could at least compete.
Tamim Iqbal c Thomas b Narine 22
Anamul Haque lbw b Narine 33
Naeem Islam c Pollard b Narine 4
Mushfiqur Rahim c Sammy b Permaul 38
Nasir Hossain c Pollard b Permaul 6
Mominul Haque c Pollard b Gayle 12
Mahmudullah c Sammy b Smith 52
Mashrafe Mortaza st Thomas b Narine 0
Sohag Gazi c Gayle b Sammy 30
Abdur Razzak c Bravo b Sammy 3
Rubel Hossain not out 1
Extras: (lb-4, lb-3, w-18, nb-1) 26
Total: (all out 49.1 overs) 227
Fall of wickets: 1-57, 2-61, 3-67, 4-78, 5-110, 6-168, 7-171, 8-210, 9-225.
Bowling: Ravi Rampaul 4-0-19-0 (w-1), Darren Sammy 9.1-0-46-2 (w-2), Sunil Narine 10-0-37-4 ( nb-1 w-2), Veerasammy Permaul 10-0-40-2 (w-1), Chris Gayle 10-1-36-1 (w-7), Kieran Pollard 2-0-21-0 (w-1), Dwayne Smith 3-0-14-1, Marlon Samuels 1-0-7-0.
C. Gayle c Rahim b Mortaza 4
K. Powell st Rahim b Mahmudullah 47
M. Samuels c Mahmudullah b Mortaza 126
D. Bravo c Gazi b Naeem 13
D. Smith c Naeem b Razzak 4
K. Pollard b Razzak 1
D. Thomas not out 12
D. Sammy not out 1
Extras: (lb-9, w-11) 20
Total: (six wickets, 47 overs) 228
Fall of wickets: 1-15, 2-126, 3-158, 4-178, 5-182, 6-222.
Did not bat: V. Permaul, S. Narine, R. Rampaul
Bowling: Sohag Gazi 9-1-36-0 (w-2), Mashrafe Mortaza 6-0-34-2, Rubel Hossain 5-0-42-0(w-1), Abdur Razzak 10-0-34-2, Mahmudullah 9-0-43-1 (w-4), Naeem Islam 5-1-21-1, Mominul Haque 3-0-9-0
West Indies won by four wickets and trail Bangladesh by 2-1 in the five-match series.