Nineteen people were killed and at least 40 injured when a series of explosions ripped through fireworks workshops in a town just north of Mexico City.

The dead included four firefighters and two police officers who rushed to the scene after the first explosion, only to be killed by a second wave of blasts.

Video shot from a nearby road showed a massive plume of smoke rising up from the area of the explosions in the town of Tultepec.

Other images released by local media showed wrecked buildings and scorched ground in a rural patch of modest homes and small farm plots.

Authorities said four small buildings were destroyed.

The government of the State of Mexico said in a statement that eight people from Tultepec were killed, along with the six emergency personnel and two others who have not yet been identified.

The state civil defence office later raised the death toll to 19, but did not specify who the other victims were in a statement posted to its Twitter account.

The government said emergency personnel were also among the injured.

Helicopters took the wounded to several local hospitals, and more than 300 police were dispatched to the scene.

Luis Felipe Puente, head of Mexico's civil defence agency, said there were four blasts in total and the explosions started at an unauthorised, clandestine workshop and spread as flammable material shot into the air.

He said the dead also apparently included one minor and a civil defence worker.

"The problem was that after the first explosion, people went running to help, and when the second explosion occurred, these people who ran to help were killed," Mr Puente told the Milenio news network.

Many residents in the town make a living by fabricating and selling homemade fireworks, and explosions are a regular occurrence.

But authorities have been unable to enforce safety regulations and registration requirements.

"We cannot continue to allow this kind of situation," Mr Puente said.

In June, seven people were killed and eight injured in a blast in Tultepec.

In December 2016, a massive fire at an open-air fireworks market crowded with holiday shoppers killed several dozen people.

Deadly fireworks explosions have also occurred elsewhere in Mexico.

In 2002, a blast at a market in the Gulf coast city of Veracruz killed 29; in 1999, 63 people died when an explosion of illegally stored fireworks destroyed part of the city of Celaya; in 1988, a fireworks blast in Mexico City's La Merced market killed at least 68; and in 2013, a rocket struck a lorry loaded with fireworks for a religious procession in Tlaxcala state, killing 17 people.

Safety measures at fireworks workshops and markets have been a matter of constant debate in Mexico.

While regulations exist on the books, many continue making powerful firecrackers and bottle rockets and selling them to the public.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.