The big-time gasoline thieves had already come and gone during the wee hours, filling their tanker trucks with stolen fuel and then fleeing.

Then dawn broke, and word spread that a crime gang had again tapped into a gasoline pipeline, and it was spewing fuel into a ditch. At first, only a few farmers showed up, carrying plastic jerry cans. Then dozens. Then even more. All were eager to collect what spilled fuel they could.

Gasoline fumes filled the air, and puddles of rainwater and gasoline spread amid a drizzle.

“This is a gift from God,” said one of the farmers, who gave only his first name, Frank, as he partially filled a five-gallon white plastic container with gasoline.

Never miss a local story.

Sign up today for unlimited digital access to our website, apps, the digital newspaper and more.

Mexico is plagued by rampant energy theft. In the first eight months of this year, 7.5 million barrels went missing, a rate of about 30,000 52-gallon barrels a day, enough to fill a fleet of more than 100 tanker trucks. Organized crime groups are behind much of the theft, which occurs along a network of pipelines that carry gasoline, diesel, crude oil, natural gas and petrochemicals around the nation.

The problem just keeps getting worse. In 2000, Mexico tallied 155 cases of fuel theft from pipelines. Since then, it’s been a steady climb. In 2012, thieves drilled 1,635 illegal taps. That number grew to 2,614 in 2013. This year, the number of illegal taps is expected to top 3,000.

Constant spills caused by the theft spoil the environment and rob Mexicans of a valuable resource. But the piracy also may crimp Mexico’s success in opening its energy sector to international investment. In early 2015, for the first time in eight decades, Mexico will allow foreign companies to bid for concessions and explore for energy on its soil or in its offshore waters. To deal with the piracy, and a web of corruption surrounding stolen fuel, foreign companies operating in Mexico will have to budget for high security costs.

Weak penalties for stealing oil and gasoline have exacerbated the problem.

“It’s not considered a serious crime and as a consequence, the penalties are truly reduced,” Omar Fayad Meneses, head of the Senate Commission on Public Security, said in a speech Nov. 11 in which he called for prison terms of 25 to 35 years for those involved in major energy theft. His bill is still pending.

Fayad, a member of the ruling Institutional Revolutionary Party, said he believes organized crime groups rake off $1 billion a year from energy theft.

The head of the state oil giant Petróleos Mexicanos, also known as Pemex, Emilio Lozoya Austin, has called energy theft one of the worst crimes against the nation because it hijacks revenues that otherwise would go directly into state coffers.

“Schools, hospitals and highways won’t be built,” Lozoya said.

But Lozoya said prosecutions are difficult even against the few people caught red-handed with what is believed to be stolen gasoline, diesel or crude oil.

“If you catch a presumed criminal with tanks of gasoline or diesel, it’s not a trivial matter to prove that he stole it,” Lozoya said. “He can say he got it anywhere.”

Theft from Pemex pipelines and installations involves far more than a few clandestine tanker trucks and some rogue engineers. More often, the chain of criminal involvement extends from local police to gas station owners and seemingly legitimate distribution companies. It also may penetrate deeply into Pemex itself, which enjoys a monopoly on retail sales in Mexico.

In late September, prosecutors announced they had smashed a huge energy theft ring that dealt more than 1 million gallons of stolen gasoline and diesel a month. The ring was headquartered in the central state of Guanajuato.

At the heart of the ring was Petrobajio SA de CV, a seemingly legitimate company that has held a concession since 2011 to transport gasoline for the state’s Pemex.

Petrobajio, however, also bought stolen fuel from an organized crime group that siphoned it from pipelines in Tamaulipas state, which abuts Texas, prosecutors said. As part of their raids, authorities seized 78 tanker trucks that helped transport stolen fuel to the nearby states of Jalisco and San Luis Potosi.

Organized crime was firmly in control of Petrobajio – a lesson, experts say, for foreign energy companies eager to come into Mexico.

“The use of firms that appear to be legitimate by criminal groups is a common practice in Mexico,” IHS Inc., a Colorado-based global information company, said in a report Oct. 1. A foreign company that failed to properly vet its Mexican partners might find itself not only the victim of theft, but facing potential prosecution, IHS warned.

Mexico is not alone among oil-producing nations with rampant theft. Nigeria loses an estimated 400,000 barrels a day to pirates. Indonesia is also plagued by oil theft.

As in those countries, the thievery in Mexico usually occurs at night, and the teams of crooks tapping pipelines employ a battery of skills to avoid triggering an explosion.

“You need technical expertise, engineers and welders, support crew for them, and the security side, the people with the guns,” said Dwight Dyer, a senior analyst based in Mexico City for Control Risks, a global consultancy on political and security risks with headquarters in London.

Dyer said the methods used by thieves range from drilling into pipelines to siphon off fuel to actually installing valves that allow criminal gangs to return again and again.

“It’s getting far worse,” Dyer said. “If you look at Pemex’s numbers, the number of (illegal) taps identified has roughly doubled every two years.”

“This is a major issue not only for the oil and gas sector. It’s a major issue for the country as a whole,” he added.

Pemex, one of the world’s largest companies with 155,000 employees, has been opaque about how many of its workers have been disciplined, fired or prosecuted for collaborating with organized crime. The company did not respond to email requests for an interview over a period of two months.

Outside experts say, however, that the oil and gasoline thefts could not be done without some help from within the state oil giant.

“You need people from Pemex with experience in the sector to know how to tap these pipelines without making a huge mess,” said Carlos Petersen, an analyst on Mexico with Eurasia Group, a U.S. consultancy.

Lozoya, the Pemex chief, appearing at a Nov. 5 forum, did not respond to a question about Pemex employees collaborating with organized crime. Rather, he said the oil company is spending tens of millions of dollars to detect illegal taps.

The company is installing a $282 million system to alert technicians whenever pressure drops anywhere along the 22,000 miles or so of pipelines that Pemex operates, allowing the company to respond rapidly to an illegal tap.

Most major crime groups are believed to have diversified into energy theft, including the New Generation Jalisco Cartel, the Gulf Cartel and the Zetas.

The Gulf Cartel and Los Zetas are the ones established along the Gulf Coast where Pemex has most of its installations, Petersen said.

Pemex operates all gas stations in Mexico, although individuals or companies may own them. It’s clear that a significant number sell stolen fuel from time to time.

“They are threatened if they don’t buy it. They have to buy from the mafia and from Pemex,” said Emilio Moller, a newspaper columnist in the city of Mérida.

Tabasco state has tallied more than 180 illegal taps on pipelines so far this year. That’s more than three a week, and many leave significant spills.

“It just gushes out of the pipe. This situation just can’t go on,” said Jose Manuel Arias Rodriguez of the Santo Tomas Ecological Association, an advocacy group in Villahermosa, the state capital.

Arias said little action has been taken to stop the theft.

“If you’re cynical, you begin to think a lot of people are involved,” he said.

On a recent morning, motorists along a main highway could notice a steady trickle of bicyclists and motorcyclists on the shoulder, some carrying empty jerry cans. Those heading in the opposite direction had jerry cans full of gasoline.

“When word spreads, ta-ta-ta, everybody comes running,” said Antonio Rodriguez, a 38-year-old farmer who toted a plastic jug full of gasoline. “There’s no other work around here.”

He signaled a site further along the road where he said a visitor could walk along a muddy path through sugar cane fields for 400 yards and come upon a spill.

“There’s like 100 to 150 people up there,” he said, all using buckets and sponges to skim a layer of gasoline off the surface of water in a ditch.