apo” Guzmán from a plane in Ronkonkoma, N.Y., on Jan. 19, 2017. (U.S. law enforcement/AP)

In February 2010, Cristian Rodriguez showed up at a Manhattan hotel expecting to attend a business meeting of sorts.

An information technology expert living in Colombia, he had previously set up an encrypted communications system for Joaquín “El Chapo” Guzmán, making it impossible for law enforcement to eavesdrop on phone calls placed by the alleged leader of the notorious Sinaloa Cartel.

Joining him in New York was a potential client who needed a similar system for his own shadowy crime syndicate — or so Rodriguez thought.

In fact, the man — who posed as a Russian mobster, according to the New York Times — was actually an undercover agent.

Testifying in federal court on Tuesday, FBI Special Agent in Charge Stephen Marston said the agency had become aware that cartel members were using an encrypted voice-over-Internet system to make phone calls but had been unable to crack the code.

After the clandestine meeting, however, federal agents persuaded Rodriguez to cooperate, allowing the U.S. government to listen in on hundreds of incriminating phone calls, including conversations in which Guzmán allegedly plotted drug deals and ensured that Mexican officials were being paid off to look the other way.

That evidence may prove to be crucial in Guzmán’s ongoing trial, which began nearly two months ago in federal district court in Brooklyn.

Guzmán is facing life in prison on conspiracy charges, with prosecutors contending he controlled a billion-dollar empire that trafficked narcotics and weapons into the United States and played a key role in the brutal Mexican drug wars that have left thousands dead.

Guzmán’s attorneys, meanwhile, have described him as a convenient scapegoat for the U.S. and Mexican governments and have argued that the cartel’s true leader was actually Ismael “El Mayo” Zambada, an alleged drug kingpin whose whereabouts are unknown.

But prosecutors said the phone calls played in court on Tuesday showed that Guzmán was closely involved in the inner workings of the cartel, discussing business matters such as the market for cocaine and methamphetamine in Los Angeles while also attending to more mundane concerns, like assuring an employee that the money for payroll would be coming soon.

Often, he appeared to be trying to do damage control.

In one recording, he directed an underling known as “Cholo Iván” to await word from higher-ups after kidnapping people and tying them up, “to make sure so we don’t execute innocent people,” according to an English translation that was distributed to jurors and posted online by Vice.

During the same phone call, he scolded Ivan for beating up police officers, to which Iván responded, “Well, you taught us to be a wolf, acting like a wolf, I’m remembering, and that is how I like to do it.”

In another set of calls, the Times reported, Guzmán asked an associate known as “Gato” if a new commander in Mexico’s federal police force was “receiving the monthly payment.” After confirming that the bribe had been arranged, Gato handed the phone to the commander, who assured Guzman, “You have a friend here.”

Prosecutors had previously played audio recordings of other damning phone conversations, including one in which Guzmán haggled with a Colombian guerrilla group over the price of a six-ton shipment of cocaine.

Until Tuesday, it was unclear how authorities had obtained the recordings. There were, however, hints that Rodriguez had been the weak link.

In December, Jorge Cifuentes, a Colombian drug lord who testified against Guzmán in exchange for a lighter sentence, called Rodriguez “an irresponsible person” who had allowed the cartel’s security to be compromised.

According to Vice, Cifuentes told the jury that he had sent Rodriguez to the cartel’s hideout in the mountains of Sinaloa to set up wireless Internet and an encrypted communications network. But after setting up the system, he said, Rodriguez had forgotten to renew a key software license, forcing the cartel to rely on cellphones while the encrypted network was down.

Tuesday’s trial testimony revealed that Rodriguez had not merely messed up — he had actively deceived the cartel to aid U.S. law enforcement.

According to Newsday, Marston testified that in 2011, Rodriguez persuaded the cartel to allow him to move the network’s servers from Canada to the Netherlands, where U.S. officials could more easily get a warrant to seize the phone calls as evidence.

He also installed software that meant all calls placed over the network were automatically recorded, with copies delivered directly to the FBI’s own server.

Finally, and most crucially, Rodriguez handed over the encryption keys that would allow agents to unlock the protected messages.

All told, authorities captured roughly 1,500 of the cartel’s phone conversations, including 100 to 200 calls in which Guzmán was speaking, between 2011 and 2012.

After infiltrating the secure network, investigators still had to confirm that the voice they were hearing belonged to Guzmán.

To do so, they turned to a handful of existing video recordings of the alleged cartel boss, including a video interview that he did for actor Sean Penn and Rolling Stone magazine in October 2015.

According to Reuters, Marston testified that Guzmán’s voice had a “kind of a sing-songy nature to it” with a “nasally undertone” and distinctive high pitch that made him identifiable. After Guzmán was extradited to the United States in 2017, agents were also able to listen to recordings of the phone calls that he placed from Manhattan’s Metropolitan Correctional Center, where he is currently incarcerated.

What wasn’t clear from Tuesday’s trial testimony is why Rodriguez agreed to assist the FBI by working undercover, potentially risking his own life.

The decision undoubtedly came at a significant personal cost. In a motion filed last week, prosecutors requested to limit the cross examination of an unnamed witness who they said had suffered from a stress-induced nervous breakdown in 2013 after the cartel began to suspect that he was cooperating with U.S. law enforcement and attempted to track him down.

That witness, the New York Times reported on Tuesday, is likely Rodriguez.

More from Morning Mix:

‘If you watch it, you will want to hurt yourself’: Late-night mocks Trump’s prime-time address

For months, he said his wife was too busy to answer the phone. A massacre revealed the truth.

A California man learns the $10 million reason not to tell your roommate if you win the lottery