More than 70 others were injured as the blast hit the San Pablito fireworks market in Tultepec, about 20 miles (32km) outside the city.
Video from the scene showed a large number of fireworks rocketing into the air as they caught fire.
Dozens of paramedics and police attended the scene. The cause of the explosions is not yet known.
Locals have been told to avoid the area and keep roads clear.
Eruviel Avila, governor of the State of Mexico, said some children had suffered burns to more than 90 per cent of their bodies and they were being sent to the US city of Galveston, Texas, for specialised treatment.
Most of those killed are so badly burned their bodies will have to be identified using DNA testing, he added.