In torrential rains, a landslide of mud and water from a nearby river caused the pipe to burst. The rupture occurred close to a residential area in the town of Nogales and a rest stop for truck drivers. Thousands of people were evacuated.
The mayor of Nogales said of those who were hurt, many were in serious condition.
The explosion engulfed 15 vehicles, and 20 buildings caught fire, officials told El Mundo.
Juan Bueno of the Pemex national oil company said "the avalanche brought a river of mud and water and, once it hit the road, caused a spark which set the gas on fire and that is what caused the fire."