TULTEPEC, Mexico (Reuters) - A series of massive explosions destroyed a fireworks market outside the Mexican capital on Tuesday, killing at least 31 people, injuring dozens and leaving the market a charred wasteland.

A woman walks amidst the remains of houses destroyed in an explosion at the San Pablito fireworks market outside the Mexican capital on Tuesday, in Tultepec, Mexico, December 20, 2016. REUTERS/Edgard Garrido

Television images showed a flurry of multicolored pyrotechnics exploding into the early afternoon sky as a giant plume of smoke rose above the market. Fireworks detonated in a peal of clattering bursts reminiscent of a war zone.

It was the third time in just over a decade that explosions have hit the popular San Pablito marketplace in Tultepec, about 20 miles (32 km) north of Mexico City. The detonations struck in the run-up to the busy Christmas holiday, when many Mexicans stock up on fireworks.

“People were crying everywhere and desperately running in all directions,” said 20-year-old witness Cesar Carmona.

Some children suffered burns to more than 90 percent of their bodies and were being sent to the U.S. city of Galveston in Texas for treatment, said Eruviel Avila, the governor of the State of Mexico in which Tultepec is located.

He also vowed to find and punish those responsible and to provide economic assistance to those who had lost their livelihoods.

The federal attorney general’s office opened an investigation, saying in a statement that six separate blasts caused the destruction.

Isidro Sanchez, the head of Tultepec emergency services, said earlier that a lack of safety measures was the likely cause of the blasts.

The federal police said a forensic team had been sent to investigate and that at least 70 people had been injured. Videos from the scene showed people frantically fleeing, while aerial footage revealed blackened stalls and a flattened tangle of metal and wood.

Slideshow ( 13 images )

The state’s top prosecutor raised the death toll late on Tuesday to 31, most of whom died at the market.

More than 80 percent of the 300 stalls at the market were destroyed by the explosions, said state official Jose Manzur.

He said the market was inspected by safety officials last month and no irregularities were found.

Mexican media reported there were 300 tonnes of fireworks at the market at the time of the explosions.

The head of a local pyrotechnics association told online publication Animal Politico last week that the fireworks market was the safest in Latin America, featuring “perfectly designed stalls” that could prevent any chain reaction in the event of a spark.

Federico Juarez was present when the first explosion rocked the market. “Everyone started running to escape as bricks and pieces of concrete fell everywhere,” he said.

The blasts were the latest in a long-running series of fatal explosions and industrial accidents that have rocked Mexico’s oil, gas and petrochemical industries.

A blast struck the Tultepec fireworks market in September 2005 just before independence day celebrations, injuring many people. Another detonation gutted the area again almost a year later.

“I offer my condolences to the relatives of those who lost their lives in this accident and my wishes for a speedy recovery for the injured,” President Enrique Pena Nieto said in a tweet.

Pena Nieto is the former governor of the State of Mexico, the country’s largest, which surrounds the capital.