IRAPUATO, Mexico — Soon after taking office in December, President Andrés Manuel López Obrador declared war on fuel theft, an enduring scourge that had been costing the nation billions of dollars a year.

Thieves had launched a particularly damaging attack, draining 1.5 million gallons of gasoline through a single illegal tap over 10 hours and immediately elevating the issue to the top of the administration’s agenda. But targeting the fuel theft racket as his first major security initiative also appeared to be an astute political move by Mr. López Obrador.

Brought to power on a wave of populist anger that handed him a mandate to reshape the nation, Mr. López Obrador was eager to make good on his core promises: to tackle corruption and crime, and to reduce poverty and inequality by making the country’s sources of wealth work for all.

But he inherited, on Dec. 1, a lackluster economy and an unenviable security situation. Mexico was approaching the end of its deadliest year on record, with the criminal world more fragmented and complicated than ever, enabled in part by chronic government corruption.