MEXICO CITY - A gas pipeline blast outside Mexico City killed at least 66 people.

Thieves had ruptured the line, drawing scores of people seeking free fuel.

Mexico’s president vowed on Saturday to redouble his fight against an epidemic of chronic fuel theft after thieves punctured a gas pipeline north of Mexico City, causing an explosion that killed at least 66 people and injured 76 others.

The blast underscored the deadly perils of the fuel-theft racket, which has cost the government billions of dollars a year and has been the target of a weekslong crackdown by the administration of President Andrés Manuel López Obrador.

The explosion, which occurred Friday night along a pipeline in a rural part of the state of Hidalgo, was particularly deadly because the promise of free gasoline had drawn hundreds of residents to the breach in the pipeline.

Videos taken before the blast showed a raucous atmosphere, with villagers from the rural municipality of Tlahuelilpan, including families, whooping and laughing as they filled plastic jugs, pails and canisters with the gasoline, which gushed from the break like a geyser.

In the footage, military personnel who had rushed to the scene can be seen standing by and observing the throng that had converged on the pipeline, which connects to the nearby Tula refinery operated by the government-run oil firm Petróleos Mexicanos, known as Pemex.

Fuel theft has been a longstanding problem in Mexico that, until recent years, was mostly written off by the government as a business cost, analysts said. But the problem began to worsen about a decade ago as organized crime groups started to diversify their criminal enterprises, including adding fuel theft to their portfolios.

Soaring international fuel prices made the crime particularly attractive. The crime groups co-opted officials at all levels of government using bribery and violence, and won support among impoverished local populations with a steady supply of low-cost black-market fuel and offers of relatively lucrative employment as lookouts and fuel couriers.