[What you need to know to start the day: Get New York Today in your inbox.]

In February 2010, an undercover F.B.I. agent met in a Manhattan hotel with a Colombian info-tech expert who had been the target of a sensitive investigation. The I.T. specialist, Christian Rodriguez, had recently developed an extraordinary product: an encrypted communications system for Joaquín Guzmán Loera, the Mexican drug lord known as El Chapo.

Posing as a Russian mobster, the undercover agent told Mr. Rodriguez he was interested in acquiring a similar system. He wanted a way — or so he said — to talk with his associates without law enforcement listening in.

So began a remarkable clandestine operation that in a little more than a year allowed the F.B.I. to crack Mr. Guzmán’s covert network and ultimately capture as many as 200 digital phone calls of him chatting with his underlings, planning ton-sized drug deals and even discussing illicit payoffs to Mexican officials. The hours of Mr. Guzmán speaking openly about the innermost details of his empire not only represented the most damaging evidence introduced so far at his drug trial in New York, but were also one of the most extensive wiretaps of a criminal defendant since the Mafia boss John Gotti was secretly recorded in the Ravenite Social Club.

The existence of the scheme — and several of the phone calls — were revealed for the first time Tuesday as Stephen Marston, an F.B.I. agent who helped to run the operation, appeared as a witness at Mr. Guzmán’s trial. In a day of testimony, Mr. Marston told jurors that the crucial step in the probe was recruiting Mr. Rodriguez to work with the American authorities.