It was an escape tunnel of love.

Joaquin “El Chapo” Guzman’s beauty-queen wife was more than just arm candy for the notorious drug lord — she also arranged his audacious 2015 underground escape from prison, the kingpin’s former right-hand man testified Wednesday.

As Chapo’s spouse Emma Coronel Aispuro, 29, looked on during her 61-year-old husband’s trial in Brooklyn federal court, former Sinaloa cartel capo Damaso Lopez Nuñez revealed for the first time her alleged role in the infamous jailbreak — an elaborate, months-long plan to dig into the drug lord’s cell and whisk him away through a tunnel on a motorbike.

The plot began in 2014, after Chapo — who’d already busted out from behind bars in 2001 — was recaptured and thrown in Altiplano prison, a high-security lockup near Mexico City.

Lopez said he received a series of letters from Guzman instructing him to meet with “the mother of the twins” — referring to the two young daughters he shares with Coronel.

They met in March, where he says Coronel told him Guzman “was thinking of taking the risk of again escaping from prison and was wondering if I could help with that.”

“I said sure,” said Lopez, who first met Guzman while a corrupt prison official at the facility from which the narco chief fled in 2001.

Coronel and Lopez then met with some of Chapo’s many sons, where she relayed that the cartel kingpin wanted the sons to purchase land near the prison, an armored truck and a GPS watch, Lopez said.

The land was a base from which they could tunnel into the prison — and the watch would allow them to pinpoint the exact coordinates of Chapo’s cell within the facility.

“It wasn’t something you could just do overnight,” Lopez said.

The sons bought both the land and the watch, and during another meeting in 2015, Coronel said Guzman was “already hearing noises where he was.”

“He was saying they were excavating underneath,” Lopez said.

When they were done, the sophisticated tunnel was equipped with lighting and air ventilation and ran for a mile — from a hole inside a partially constructed house on their land all the way to the shower in Chapo’s cell, authorities later found.

Guzman later told Lopez the tunneling operation was so brazen that other inmates “were complaining of the noises that they heard,” he added.

The escape finally went down on July 11 — a Saturday, because Chapo knew there would be no officials or “people from the courts” around, according to Lopez.

Security footage from Chapo’s cell that day later showed he cranked up the volume on his TV while loud hammering could be heard in the background.

He then he slipped his shoes on — and disappeared behind a small dividing wall obscuring the shower from view.

Guards didn’t come to check on his cell for another 20 minutes.

Meanwhile, Guzman had descended 33 feet underground to an old motorbike rigged up on a rail line inside the passageway and was riding through the tunnel to freedom.

“When he got to the exit, he was on the piece of land we bought,” Lopez testified.

Aided by Coronel’s brother, Guzman then rode an ATV to a warehouse Lopez had rented and from there was transported to an airstrip “where a plane was waiting to take him to Sinaloa,” Lopez said.

When Guzman was captured again about six months later, in January 2016, he was again thrown into Altiplano — and Lopez and Coronel again planned to bust him out.

“My comadre [Coronel] told me my compadre [Guzman] sent his regards and that he was going to make a huge effort to escape again,” Lopez told the court.

Guzman sent $100,000 to buy land near the lockup again, but he was transferred to a different prison in Ciudad Juárez, he said. Lopez said a top prison official was bribed $2 million to send Chapo back to Altiplano — but it never happened, and Guzman was extradited to the United States in January 2017.

In court Wednesday, Coronel sat emotionless in the farthest corner of the defense row, playing with her hair and staring at her nails, as Lopez implicated her in the caper.

The bombshell brunette has not been charged with any crimes in Mexico or the United States, and both the defense and the US Attorney’s Office for the Eastern District of New York declined to comment on her alleged involvement.

Despite describing Coronel’s pivotal role in her husband’s escape, Lopez later tried to downplay her involvement under cross-examination.

“What you said is Emma was involved in planning it?” attorney Eduardo Balarezo asked him.

Lopez replied: “No, what I said is she was bringing a message.”

He also denied having any personal knowledge of the tunnels until after the breakout.

“I never knew about even one shovel of earth. His sons were in charge of digging it directly,” Lopez said.

Balarezo — whose defense team contends Chapo’s fabled jailbreaks were fabricated to inflate their client’s role in the cartel — also questioned why the leader of a powerful criminal organization would have to cook up such a wild plan instead of using good old-fashioned bribery.

“It would have been really easy for this cartel leader to just pay someone a million dollars and just walk out the door,” the attorney noted.

Lopez said he “chose to do it another way.” “Pretty spectacular, right?” said Balarezo.

“It is very real,” responded Lopez.

Balarezo also attempted to mock the reputed details of Chapo’s 2001 prison escape — when Lopez testified that he escaped by hiding in a laundry cart pushed by a worker named Chito — by entering a satirical photo composite of the incident into evidence.

“For demonstrative purposes only, Your Honor,” he said with a smile as he laid down his collage, which featured the cropped head of his client floating in a laundry basket that was being pushed by a man wearing sombrero and a bright shirt stamped with “Chito.”

Prosecutor Amanda Liskamm immediately objected, but the image remained projected long enough for the jurors to see it and burst out laughing. Asked about the photo, Balarezo told The Post he was inspired to create the composite to illustrate the myth that surrounds his client but declined to comment further.

Lopez resigned from his high-ranking security job at Puente Grande prison just a year before Chapo was allegedly secreted out in the pile of soiled sheets, and later joined the cartel.

By the time Guzman was locked up again in 2014, the pair were so tight the kingpin signed off his letters from “your compadre, who loves you and appreciates you.”

Three such handwritten notes were shown to the jury on Wednesday.

In one April 2014 missive, Guzman advised Lopez that “no one should know” where he sleeps in case someone in the cartel snitches.

“The danger is the people from the company, because they are the ones who know about you and they are the one who can set you up,” Chapo wrote

“Without a ‘finger,’ ” he continued, using the Spanish slang for snitch, “they will never find you. And a finger will always be someone close to us.”

He also offered more mundane advice.

“The crop duster should be started and flown so it doesn’t get ruined,” Guzman wrote in a letter the following month.

But by 2016, Lopez had fallen out with Chapo’s sons — and said he had to have his own private army to protect himself and his own family from them.

Jurors were shown a patch his hit men wore, featuring a rooster standing on a skull and crossbones in front of crossed rifles, with “FED” along the top — standing for “special forces of Damaso” in Spanish.

Lopez was taken aback when he saw the patch and said one of the gunmen had made it on his own.

Balarezo asked where that gunman is now. “In his tomb,” Lopez responded.

The attorney asked if Lopez put him there.

“No, but my compadre’s sons did,” he said.

Still, Lopez — who was arrested in 2017 and extradited to the US — professed his “love” for Guzman, despite testifying against him this week.

Balarezo asked Lopez why he looked at Chapo and bumped his fist to his heart before beginning his testimony — as many of the cartel turncoats have done throughout the trial.

“Because I love him,” Lopez said.