The crude bomb exploded during a transport blockade on Saturday evening in the port city.
The decision to leave the country was taken on the advice of security manager Paul Slowe, the West Indies Cricket Board (WICB) said.
"The report emphasized that the current security environment in Bangladesh is not conducive to the playing of cricket in light of the 72 hours nationwide blockade and calls for countrywide dawn to dusk protest," the WICB said.
"Travel arrangements are being made to allow for the team's return to the Caribbean as quickly as possible.
"The team will remain safely accommodated at the team hotel under adequate security protection until departure from Bangladesh."
Bangladesh has been rocked by violent protests and a series of shutdowns and transport blockades led by the main opposition party, which is demanding the prime minister step down and elections be held under a non-party administration.
More than 60 people have been killed in the country since last month.
There was no immediate comment from the Bangladesh Cricket Board.
Bangladesh are scheduled to host Sri Lanka for a full series from January, followed by the Asia Cup and the Twenty20 World Cup in March-April.
Photograph: Courtesy: WICB
Beaten England must look into their souls: Cook
Embarrassed to overtake Viv Richards' record, says Amla
Proud to beat the No 1 ODI team, says SA skipper A B de Villiers
Australia whip England in second Ashes Test by 218 runs
Here's what Dhoni thought made the difference in the 2nd ODI...