MEXICO CITY —Mexico’s decision Friday to approve the extradition of Joaquín “El Chapo” Guzmán helps clear the way for the infamous drug lord to face what has long been his worst nightmare: living behind bars in a U.S. prison.

The extradition of Guzmán, who has publicly claimed responsibility for delivering much of America’s cocaine and heroin and has fought bloody battles with rival traffickers, could still be months or even years away. His lawyers vowed Friday to appeal the ruling by the Mexican Foreign Ministry.

But the government’s decision marks a recognition that the political stakes have changed dramatically since Guzmán escaped for a second time from a Mexican federal prison last summer.

After his first recapture in 2014, Mexican authorities rejected U.S. pressure and vowed to force Guzmán to face justice on his home soil, making it a point of pride that they could hold him secure, extract intelligence from him and successfully convict him for his role leading the Sinaloa drug cartel. Those boasts collapsed last July when Guzman slipped away from a maximum-security prison west of Mexico City through a mile-long tunnel and went on the lam in the rugged mountains of his home state along Mexico’s Pacific coast.

This time, after Guzmán was recaptured in January, President Enrique Peña Nieto’s administration has moved methodically toward extraditing him to the United States. The president’s approval ratings have already fallen from earlier in his term, fueling worries about enduring another humiliating escape.

Mexico’s new attorney general, Arely Gómez González, has also been far more willing to extradite prisoners than her predecessor, Jesús Murillo Karam, who predicted that Guzmán would die in a Mexican jail.

Foreign Ministry officials visited Guzmán on Friday in his cell in a federal prison in Ciudad Juárez, along the Texas border, where he was moved earlier this month, to inform him of their decision to proceed with his extradition. In a statement, the ministry said Guzmán would face a raft of charges from two U.S. federal jurisdictions – the Western District of Texas and the Southern District of California – including murder, money laundering, weapons possession, distribution of cocaine and other alleged crimes. It said Mexico, which has abolished the death penalty, received guarantees that it would not be sought against Guzmán in the United States.

Guzmán also faces U.S. charges in Chicago, New York and Miami, among other jurisdictions.

The U.S. Embassy in Mexico confirmed that the death penalty was off the table, “consistent with our extradition assurance policies with Mexico.” In Washington, a Justice Department official said it was not immediately clear where Guzmán, if extradited, would be tried.

U.S. Attorney General Loretta E. Lynch said recently that Justice Department officials would “look at all of the relevant charges against him” and determine which jurisdiction could generate a case covering most, if not all, of the alleged criminal conduct.

For Mexico, extradition offers the benefit of dropping a political hot potato and avoiding the dilemma of securing a prisoner who has proven his ability to bribe a range of officials and whose allies are adept at building tunnels, flying private planes to hideouts, operating a network of safe houses and constructing high-tech escape hatches.