NEW YORK — Joaquín Archivaldo Guzmán Loera, the notorious drug lord known as “El Chapo” whose dramatic prison escapes fed his legend as an untouchable kingpin running the world’s largest narcotics trafficking group, was sentenced Wednesday to life in prison.

Before the sentence was imposed, Guzmán, 62, turned to look at his family in the packed courtroom. He saluted them, tapped his heart and then angrily denounced his treatment while in U.S. custody.

“When extradited, I expected to have a fair trial where justice was blind and my fame would not be a factor, but what happened was actually the opposite,” he said before the sentence was imposed. “The government of the United States will send me to a prison where my name will never be heard again. I will take this opportunity to say there was no justice here.”

By decapitating Mexico’s most powerful organized crime group, Guzmán’s bloodthirsty Sinaloa Cartel, the Justice Department has scored a major victory. Such organizations, however, have proved remarkably resilient in the face of their leaders’ arrests and extraditions, and current and former U.S. law enforcement officials say corruption within the Mexican government remains a troubling obstacle.

Speaking through an interpreter and reading from prepared remarks, Guzmán characterized the harsh terms of his confinement in Manhattan’s Metropolitan Correctional Center as “psychological, emotional, mental torture, 24 hours a day.” Guzmán, who personally ordered people to be tortured and murdered, said his prison conditions showed a “lack of respect for human dignity” and blamed the judge for his conviction.

“The U.S. is not better than any other corrupt country,” Guzmán said.

In sentencing him to spend the rest of his life in prison, U.S. District Judge Brian Cogan said the law gave him no discretion to impose a lighter sentence and that the drug lord did not deserve leniency.

“The overwhelming evil is so severe,” Cogan said.

Federal sentencing laws made it a foregone conclusion that Guzmán would receive multiple life sentences, and his lawyer Jeffrey Lichtman spent little time asking the judge for mercy.

“History will treat this verdict with skepticism,” Lichtman said. “What occurred here did not uphold an appearance of justice.”

Guzmán was convicted in February after a three-month trial that detailed his murderous rise to power in Mexico, where his Sinaloa Cartel moved billions of dollars’ worth of heroin, cocaine, methamphetamine and marijuana from Mexico to the United States. The jury deliberated for six days before finding him guilty on all 10 counts on the indictment.

Witnesses at the trial described multimillion-dollar bribes paid to senior Mexican officials to keep the cartels running. Defense attorneys had argued that Guzmán was a scapegoat, railroaded by “gutter human beings” lying to save themselves.

Renowned for escaping two maximum-security prisons in Mexico — first in 2001, with the assistance of prison guards, and again in 2015 through a tunnel beneath the shower in his cell — Guzmán was recaptured in 2016 after a meeting with actor Sean Penn tipped authorities to his whereabouts near Mexico’s northwestern coast. He has lived in solitary confinement since his extradition from Mexico the following year.

Last month, the judge denied Guzmán’s application for more comfortable prison conditions, citing prosecutors’ suggestions that the request could be part of a ploy to escape from prison for a third time.

The trial was conducted under extremely tight security in downtown Brooklyn. He probably will serve his sentence at the supermax prison in Florence, Colo., where some of the nation’s most dangerous criminals are held, including World Trade Center bomber Ramzi Yousef, “Unabomber” Theodore Kaczynski and double agent Robert Hanssen.

One of Guzman’s victims, Andrea Velez Fernandez, addressed the court Wednesday, saying: “Today, I want to stop being a name without a face.” Weeping, she said it was a miracle that she was still alive “because Mr. Guzmán tried to kill me” by using her as bait to kidnap an Ecuadoran official.

Prosecutors introduced extensive evidence throughout the trial — including 1 million intercepted messages between alleged cartel members and testimony from 14 cooperating witnesses — detailing ghastly killings in addition to the smuggling.

The proceedings offered vivid insight into the cartel’s “brutal force and intimidation,” its reach and the profits it reaped. Over 25 years, Guzmán earned the organization more than $14 billion while exhibiting an extraordinary ability to evade law enforcement.

The trial produced mind-boggling descriptions of alleged corruption, including one witness who said Guzman paid a $100 million bribe in 2012 to former Mexican president Enrique Peña Nieto, who has denied taking such payoffs.

It also featured dramatic testimony about Guzmán’s strange life as a criminal mastermind. A woman with whom he was romantically involved wept on the witness stand. Other witnesses described how he traveled in an armored car, built an army of killers to fight his rivals and enemies, and wiretapped his family and close associates, including his wife and other women.

Paranoia played a major role in his undoing. The cartel’s IT technician, Christian Rodriguez, who installed the spyware system for Guzmán to monitor those around him, eventually gave the system to the FBI. After Guzmán learned that Rodriguez was cooperating with U.S. authorities, El Chapo ordered his associates to find and kill him. They were unsuccessful, and ultimately Rodriguez testified in court.

Brian Benczkowski, head of the Justice Department’s Criminal Division, said after the sentencing that “the long road that led Chapo Guzmán from the mountains of Sinaloa to the courthouse today was paved with death, drugs and destruction, but it ended today with justice.”

“Mr. Guzman thought for more than 25 years that he was untouchable — that there was no problem affecting the Sinaloa cartel that he couldn’t bribe, torture or kill his way out of,” Benczkowski said, adding that the sentence today brings “a measure of justice” for both the United States and Mexico.