MEXICO CITY – President Andres Manuel Lopez Obrador urged Mexicans Wednesday not to panic as gasoline shortages spread across the country, caused by a crackdown on fuel theft that risks backfiring badly.

The president says the shortages were triggered by his administration's decision to temporarily close some of state oil company Pemex's pipelines - part of his bid to wipe out rampant fuel theft that cost the country an estimated $3 billion in 2017.

But for a politician who campaigned on energy nationalism and a promise of more Mexican refineries to produce more cheap gasoline, the shortages have turned into a public relations debacle.

At his daily press conference, Lopez Obrador - an anti-establishment leftist who took office last month after a landslide election win - vowed to keep up his fight against fuel theft and urged Mexicans not to make the shortages worse with panic buying.

"We're going to resist the pressure. I'm asking people to help us. How can you support us? By acting prudently and calmly, without panicking, without listening to alarmist and biased information," he said.

"There is enough gasoline in the country... We are in the process of returning to normal deliveries."

That was little comfort for customers like Alfonso Mendoza, a travelling salesman who spent more than four hours waiting to fill up his car after a week of shortages.

He lives in the central city of Guanajuato, where some people spent the night in their cars, queued up outside the limited number of functioning service stations.

"I couldn't go to work today. I have to travel for my job, so it affects me a lot. It's not good, what (the president) is doing," said Mendoza.

"He's trying to catch the thieves, but we're the ones who get screwed."

ECONOMIC IMPACT

The pipeline closures have led to shortages in various places around Mexico, particularly in the centre of the country, as service stations run out of fuel or limit customers to purchases of 10 litres (about two and a half gallons).

Mexico City is among those affected, though officials insist the fuel supply to the capital is normal and the shortages are being caused by panic buying.

Nonetheless, shuttered service stations could be seen around the city, and customers spent hours in line at those that were open.

Energy analyst Ramses Pech said there were not enough tanker trucks in the country to compensate for the pipeline closures. The legal distribution system was also under greater pressure than usual because of the crackdown, he said.

"They turned off the pipelines and people who had been buying stolen fuel had to return to service stations. They didn't have enough volume to meet demand," he told AFP.

Analysts at private bank Citibanamex said the shortages could hit Latin America's second-largest economy if they continued.

And the Eurasia Group consultancy warned the episode could "ding the president's popularity" and augur tough times ahead for a leader who tends to make policy by "instinct."

"The faulty implementation of the strategy to fight fuel theft shows some of the administration's weakness," it said.

There were 10,363 pipeline thefts in 2017, up from 186 in 2012, according to Pemex.

Authorities say the crime is partly an inside job. Lopez Obrador confirmed Tuesday that Pemex's former security chief is among those under investigation.

To crack down on fuel theft - known in Mexico as "huachicoleo," or moonshining - the government has deployed the military to escort fuel shipments and guard Pemex production facilities, inspecting workers as they enter and exit.

Lopez Obrador has also introduced legislation to reclassify fuel theft as a major crime not eligible for bail.