TULTEPEC, Mexico—Powerful blasts ripped through a sprawling fireworks market outside Mexico City on Tuesday, killing at least 31 people and injuring scores more, the third time in 11 years that the market has been destroyed by such explosions.

The midafternoon explosion tore through hundreds of small stalls selling artisanal fireworks in the San Pablito market in the city of Tultepec, just north of the Mexican capital. Mexico State Gov. Eruviel Ávila said that in addition to the deaths—most of which were at the scene, with...