The wife of the Mexican drug lord Joaquín “El Chapo” Guzmán played a key role in his infamous 2015 escape from prison through a tunnel dug into the shower of his cell, one of Guzmán’s top lieutenants told a court in New York.

Dámaso López Núñez told the jury at Guzmán’s trial that Emma Coronel Aispuro helped her husband trade messages with his sons and others who coordinated the breakout at Altiplano prison in central Mexico.

Coronel “was giving us his orders”, López said, adding that she also was in on meetings about the escape.

After Guzmán was recaptured and thrown in another Mexican lockup, the cartel paid a $2m bribe to a prison official to get him moved back to Altiplano, López said.

Before that could happen, Guzmán was extradited in 2017 to the US, where he has been kept in solitary confinement.

The testimony cast a harsh spotlight on Coronel, who has sat quietly in the courtroom for most of a trial that began in mid-November. Most of the attention on her so far has been for her wardrobe and her reaction to waves from the defendant. At a lunch break, she did not speak to reporters and Guzmán’s lawyers declined comment.

Known by his alias “El Licenciado”, which is a title for college graduates, López, 52, was once a close confidant of the kingpin.

He was extradited to the US in July and is now serving a life sentence in prison for drug trafficking, and has said he is cooperating with prosecutors in the hope of getting the sentence reduced.

He has testified that he began working for Guzmán in 2001 and is a godfather to one of his former boss’s twin daughters.

López told jurors that he plotted his boss’s escape with Coronel and Guzmán’s sons, with Coronel passing messages to and from Guzmán.

As described by López, the 2015 escape was far more elaborate than one Guzmán pulled off in 2001 by hiding in a prison laundry cart. It included smuggling a phone with GPS to Guzmán so the plotters could determine where best to tunnel in, he said.

His followers also bought property adjacent to the facility, so they could dig the mile-long (1.6-km-long) escape route, López said. Work went on for months and was so loud it could be heard behind bars – to the point where inmates were complaining about it, he said.

On the day of the breakout, a motorcycle was used to race Guzmán to the exit of the tunnel, where an ATV took him to a warehouse, the witness said. He was later flown to his mountaintop hideaway.

The government’s case at the trial in federal court in Brooklyn is expected to conclude this week. The defense has included Guzmán on a list of potential witnesses, but lawyers have been mum about whether he would chance actually testifying.

When López first stepped up to the witness stand on Tuesday, he looked at Guzmán and bumped his fist to his chest. Asked by one of Guzmán’s lawyers on cross-examination on Wednesday why he made the gesture, López answered, “Because I love him.”

Nonetheless, López said, “the circumstances” compelled him to testify.

“I chose to think about my family,” he said.