At least 16 people have died after a huge fire broke out at a garment factory in Bangladesh, with officials warning that the toll could rise.

Sixteen bodies have been recovered and would be handed to families after DNA testing, as they have been burnt beyond recognition, the fire service said.

Distraught relatives gathered outside the four-storey factory in Dhaka's Mirpur area on Tuesday in search of their loved ones still missing.

The blaze, which broke out at the factory around midday, was extinguished after three hours. But an adjacent chemical warehouse continued to burn, authorities said.

Large fires are relatively common in densely populated Bangladesh, often due to lax safety standards and poor infrastructure. Hundreds of people have been killed in fires in recent years.

According to eyewitnesses, the chemical warehouse stored bleaching powder, plastic, and hydrogen peroxide, all of which can intensify fires. Most of the deaths were caused by toxic gas and the building's roof door being locked.

Fire service director Mohammad Tajul Islam Chowdhury told local media the victims probably died instantly after inhaling highly toxic gas.

The investigation is ongoing to ascertain the legality of the warehouse’s operations and whether proper safety measures were in place. The fire service confirmed that the warehouse had no fire safety clearance or license.

Bengladesh has a painful history of industrial disasters. Previous incidents, including the 2013 Rana Plaza collapse, have prompted calls for better safety regulations in the garment industry, which is a significant sector for the country's economy.

As families search for their missing loved ones, authorities face scrutiny over ongoing safety issues in Bangladesh's industrial sector.