A ruptured pipeline in central Mexico has exploded, killing at least 20 people and burning at least 61 others who were trying to fill containers with fuel, authorities say.

The leak was caused by fuel thieves illegally tapping the pipeline in a small town in the state of Hidalgo, about 100 kilometres north of Mexico City, according to state oil company Petroleos Mexicanos, or Pemex.

Hidalgo Governor Omar Fayad said 20 people were killed immediately and 60 suffered burns in the blast at the duct that carries fuel – apparently petrol – from the Gulf Coast to the Mexico City area.

"Caring for the wounded is our top priority," Fayad wrote.

Pemex attributed the blaze to "the manipulation of an illegal tap".