Anguished families kept vigil outside the morgue of Bangladesh's largest hospital on Friday, waiting for the bodies of loved ones to be identified after a fire they say should never have happened.

At least 46 people were killed in Thursday night's blaze in an upscale neighbourhood of the capital Dhaka, which broke out in a popular biryani restaurant and quickly engulfed a seven-floor commercial building.

Most of those who perished suffocated in the smoke, while the bodies of others were burned beyond recognition in the resulting inferno.

Among the dead was young university student Minhaj Khan, whose failure to escape the fire was witnessed by a friend with him at the restaurant, and confirmed to AFP by his older cousin at the hospital.

Khan's mother had travelled to the hospital insisting his companion was mistaken, angrily sending away doctors requesting a DNA swab to check against bodies brought to the morgue.

"I won't listen to anyone. I don't believe any of you. I only want my son. Nothing else," she told AFP, declining to give her name.

"He promised to take me to Mecca for the pilgrimage. How can I go to Mecca without him?"

It took fire crews two hours to bring the blaze under control, with members of the public stepping in to carry hoses and help guide those escaping from the building to safety.

Before they arrived, many inside had rushed upstairs to the rooftop to escape the quickly spreading inferno.

Kazi Taslim Uddin said his 20-year-old son was among the dozens being treated in hospital for injuries after being forced to clamber down the side of the building.

"He tried to go to the ground floor but failed as people were rushing up the opposite way," he told AFP.

"He grabbed some cables and tried to climb down but they weren't long enough," he added.

"He jumped and got injured. His lungs were also scorched by the smoke."

- 'Could have saved many lives' -

Thursday marked the latest in a long list of deadly fire incidents in the Muslim-majority nation, where building safety standards are lax and corruption often allows them to be ignored.

But they are more common in industrial complexes and tenement buildings, and the blaze in one of Dhaka's more well-heeled neighbourhoods was a deep shock to many in the city.

Firefighters said the latest blaze was accidentally sparked from an improperly stored cooking gas cylinder, and made much worse by the quick chain-reaction explosions of other canisters stored haphazardly around the building.

Bereaved family members at the Dhaka Medical College Hospital were furious that nothing had been done to alert the public to the fire risk at the restaurant beforehand.

"It could have saved many lives," said one man waiting to retrieve the body of a cousin who perished in the blaze, who declined to identify himself.

"All these buildings are ticking time bombs. The regulators wake up only after the disaster occurs."