The blast occurred Friday night as people were finishing their prayers at Baitus Salat Jame Mosque at Narayanganj, local police chief Zayedul Alam said.
By Saturday afternoon, 16 people, including a 7-year-old boy, had succumbed to their injuries. Doctors at a burn unit of a state-run hospital were treating at least 37 people with burns on up to 90% of their bodies, said Samanta Lal Sen, a coordinator of the unit.
TV stations reported that because of the impact of the blast, at least six air conditioners also exploded inside the mosque.
Firefighters were investigating the cause of the explosion.
Abdullah Al Arefin, assistant director of the Fire Service and Civil Defense, said that officials suspected that gas had accumulated inside the mosque from a leak in the underground pipeline, and that it had gone unnoticed.
“The gas could not go out as the windows of the mosque were shut because of the air conditioners,” he said.
Faulty installation of gas lines are often reported by Bangladeshi media, while unplanned road-digging work often leads to disasters in the country, which is seeking rapid industrial expansion and economic development.