A gas pipeline in the Mexican state of Hidalgo exploded on Friday night, killing at least 21 people in a blast the authorities said was caused by an illegal tap used to steal fuel.

Omar Fayad, the governor of Hidalgo, said on Twitter that more than 70 others were injured in the explosion in Tlahuelilpan, a town about 80 miles north of Mexico City.

The state-run energy company, Pemex, said that the explosion was caused by an illegal fuel tap at the Tuxpan-Tula pipeline.

[The death toll soars as officials begin an in-depth examination.]

The country has been plagued by fuel thefts, and Mr. Fayad called on Mexicans “not to be accomplices.” He said the practice was not only illegal, but it also “puts your life and families at risk.”