The Tigers needed to score 231 runs to seal the game and level the series. But they managed to score 213 runs in the fourth innings and lost the match by 17 runs.
The Tigers lost the first game in Chattogram by three wickets.
Bangladesh started with a solid first-wicket stand as Tamim Iqbal and Soumya Sarkar added 59 runs at Sher-e-Bangla National Cricket Stadium.
After Rahkeem Cornwall removed Soumya for 13, the Tigers lost two more wickets before posting 100 runs on the board.
Also read: Dhaka Test: West Indies off to solid start against Tigers
Mominul Haque (26), Mushfiqur Rahim (14), Mohammad Mithun (10) and Liton Das (22) managed to make a good start but they failed to carry on.
Mehidy tried his best scoring 31 with three fours and two sixes. But it was already too late.
The all-rounder was caught by slip fielder Rahkeem Cornwall as he tried to defend a ball off Jomel Warrican in the 62nd over.
Cornwall was the hero for the West Indies in the game, picking up nine wickets in the match conceding 179 runs. He bowled 62 overs in Dhaka Test.
Also read: West Indies opt to bat first in 2nd Test
Earlier, the Caribbeans managed to score 117 runs in 52.5 overs in their second innings as Taijul Islam and Nayeem Hasan shared seven wickets and Abu Jayed took two while Mehidy bagged one.
Nkrumah Bonner (38), Joshua Da Silva (20) and John Campbell (18) were the only West Indian batsmen to reach the double-digit in the second innings.
With a handy lead of 133 from the first innings, the West Indies set a target of 231 for the hosts to level the series. But the Tigers proved that this target was also too much for them as they lost quick wickets.
It was Bangladesh's first clean sweep after the 2012-13 season. Overall, it was Bangladesh's 15th whitewash in a series with two or more matches.
Also read: Shadman ruled out of 2nd Test vs West Indies
Ahead of the Tests, both teams locked horns in a three-match ODI series which Bangladesh won 3-0. But the West Indies made a formidable comeback in the Tests.
Dhaka Test score
West Indies (first innings) 409/10 in 142.2 overs (Joshua 92, Bonner 90, Joseph 82); Abu Jayed 4/98, Taijul 4/108, Soumya 1/48
Bangladesh (first innings) 296/10 in 96.5 overs (Liton 71, Mehidy 57, Mushfiqur 54); Cornwall 74/5, Gabriel 3/70
West Indies (second innings) 117/10 in 52.5 overs (Bonner 38, Joshua 20, Campbell 18); Tajul 4/36, Nayeem 3/34, Abu Jayed 2/32
Bangladesh (second innings) 213/10 in 61.3 overs (Tamim 50, Mehidy 31, Mominul 26); Cornwall 4/105, Brathwaite 3/25, Warrican 3/47
Result: West Indies win the match by 17 runs