At least 21 people, including 10 children and eight women, were charred to death in a devastating fire that raged though a congested industrial slum in Bangladesh's northeastern port city of Chittagong on Tuesday.

At least 10 people were also critically injured in the blaze that broke out at about 1.15 AM (local time), trapping the residents inside the slum surrounded by concrete walls at Boubazar area, about 215 km from Dhaka.

Fire fighters had to stretch their hosepipes to more than two kilometres through the narrow lanes of the congested area and had to struggle for three hours to put out the blaze, which destroyed nearly 30 dwellings.

The slum mainly housed garment workers and warehouses storing fabrics, which were believed to be responsible for the rapid spread of the fire.

Most of the bodies were lying near the inside boundary wall of the habitat, they said.

"It appeared that they tried to come out of the boundary wall after the fire broke out," a witness said.

Hospital sources and police said at least 10 people were being treated with severe burn injuries.

The incident comes a week after four people were killed in a blaze at an 11-storey building housing two private television stations in the national capital.