A gasoline pipeline leak early Wednesday in the western Mexican state of Jalisco forced thousands of people to evacuate their homes, although it was brought under control a few hours later, authorities said.

The leak in the conduit, operated by state-owned oil monopoly Petroleos Mexicanos, began early Wednesday in a rural area outside the town of Tlajamulco as a result of an illegal fuel tap, prompting authorities to issue an alert over a possible explosion or fire.

Firefighters and Pemex technicians, however, were able to stop the leak shortly after midday, the Jalisco state government said.

Roughly 4,500 people had to evacuate their homes due to the risk of a fire or inhalation of toxic fumes.

Rainfall in the area helped prevent a fire from starting after the leak occurred, Tlajomulco's mayor said.

The hole drilled in the pipeline caused a plume of fuel to rise dozens of meters into the sky and a large amount of gasoline to spill on the ground.

Once the leak was brought under control, the thousands of evacuees were able to return to their homes, authorities said.

Pemex suffers hundreds of incidents of hydrocarbon theft every year, in some cases involving organized crime gangs that illegally tap pipelines and sell the product on the black market.

In 2012 alone, a total of 8.2 million barrels were stolen from Pemex-operated pipelines in 1,744 illegal fuel taps.

On Dec. 19, 2011, a pipeline leak believed to have been caused by an illegal tap in the central town of San Martin Texmelucan triggered an explosion and fire that killed 30 people and left dozens of others injured. EFE