From a few kilometers (miles) away, the multiple explosions almost looked festive, alight in blue, red and white. They were anything but. The scorched remains of the San Pablito market looked like something from a post-apocalyptic film, with little left standing in the smoldering ruins.
The explosion sent a vast cloud of smoke billowing over the capital. An acrid smell hung in the air well into the night.
Fire crews struggled for three hours before bringing the blaze under control. The head of the civil protection service, Luis Felipe Puente, said crews had to wait for all the fireworks to finish exploding before they could extinguish the flames.
"The entire market is gone," he said. It had more than 300 stands. Several of the injured were in "delicate condition," he added.
Small explosions continued to startle locals through the night. Authorities said they were controlled blasts to eliminate remaining gunpowder. Homes and vehicles nearby were also severely damaged. In some areas, emergency workers were gently probing for survivors under heaps of charred and twisted roofing material.
People desperately searching for family and friends shouted and gestured to rescuers about where they hoped the missing might be found.
RELATED: Ancient Wind God Temple Found Under Mexico City Supermarket
The military, which is in charge of issuing fireworks sales permits, was deployed to help emergency crews transport casualties to hospitals by ambulance and helicopter. Ambulances, fire trucks, police vehicles and army trucks all crowded the sprawling blast area.
Mexico's President Enrique Pena Nieto tweeted his condolences to the families of those killed. The attorney general's office has opened an investigation into the cause of the blast, which it said was prompted by six initial explosions. State and federal investigators were combing through the burnt remains of the market.
Some locals speculated the mishandling of gunpowder or other fireworks components may have been to blame. That was the cause of an explosion at the same market in September 2005 ahead of the Independence Day holiday.
The following year, another explosion destroyed more than 200 sellers' stands. Both incidents left dozens of injured, but no fatalities.
WATCH VIDEO: How Powerful Is Mexico?