The blast in the San Pablito market in the city of Tultepec injured around 70 people, according to local reports, and flattened stalls - leaving piles twisted and charred debris.
Rescue workers were treating casualties suffering from blast and burn wounds, with some victims reportedly suffering burns to more than 90 per cent of their bodies.
Dramatic footage posted online showed a massive plume of smoke filling the air as fireworks exploded in all directions and terrified market-goers ran for their lives.
The massive explosion was captured on camera 
People ran for their lives as fireworks exploded in every direction 
We have mobilized 25 ambulances # cruzroja # Edomex and 10 # CDMX to # Tultepec where an explosion of pyrotechnics was recorded, personnel working
An aerial view of the scene after the blast 
Local residents were told to stay away from the site 
Tultepec's mayor told local media that at least 12 people were killed in the disaster.
Luis Felipe Puente, head of national emergency services, said the number of injuries could rise.
He said some homes in the area were damaged and asked people not to come within three miles of the site because it was still dangerous.
The Red Cross said it had sent more than 30 ambulances and dozens of paramedics to the scene to treat the wounded.
Video showed rescuers and market-goers walking through the debris as smoke hung in the air after the blast. 
Other footage showed people frantically using clothing in an attempt to put out fires as the cloud of smoke was visible from several miles away.
Some of the victims, including a father and child, were airlifted to hospital by helicopter. 
Dozens of ambulances were sent to the scene 
The incident occurred shortly before 3pm local time on Tuesday. 
Tultepec, north of Mexico City, is famous for its fireworks industry, and hosts the annual National Pyrotechnic Festival.
Firefighters at the scene of the disaster 
A woman walks through the rubble 
A fire engulfed the same market in 2005, touching off a chain of explosions that levelled hundreds of stalls just ahead of Mexico's Independence Day.
A similar fire also destroyed hundreds of stands in September 2006.
Security measures were implemented to prevent chain bursts after these disasters.