The blaze destroyed about 300 huts before firefighters brought it under control in Dhaka's northern Mirpur district, said Fakhruddin Ahmed, a fire brigade official.
The cause of the fire was not immediately known, he said.
Most of the victims were rickshaw drivers and poor garment workers.