At least 29 people died and 70 were injured as an explosion ripped through Mexico's best-known fireworks market on the northern outskirts of the capital on Tuesday, police said.

The conflagration, in the suburb of Tultepec, sent a huge plume of grey smoke billowing into the sky. Children were reported by local news to be among the victims.

"We recovered 26 bodies at the scene of the incident. And three more have died in the hospital, for a total of 29 dead," Mexico state's governor Eruviel Avila said.

Federal police, who had reported an initial death toll of nine, said on Twitter that 70 people were hurt and were transported to emergency rooms.

Isidro Sanchez, the head of Tultepec emergency services, said the death toll was preliminary as rescue workers scoured the site.

Fire crews struggled for three hours before bringing the blaze under control.