It’s not often a drug kingpin's trial – the stuff television movies are made of – makes bigger news not through the defendant, but because of his lawyer’s alleged dalliances.

But that's exactly what happened in the trial of Mexican drug lord Joaquin “El Chapo” Guzman, who was extradited to the U.S. in 2017 to face charges of running the Sinaloa cartel, which became the primary supplier of cocaine and other drugs across the U.S.

Hundreds of text messages the New York Post says it obtained allegedly show steamy exchanges between the attorney, Jeffrey Lichtman, and a former client, restaurateur Sarma Melngailis. She made headlines herself after being convicted in 2017 of scamming investors in her eatery, as well employees, out of $1 million. She served just under four months in jail.

EL CHAPO'S 'SECRETARY' TAKES STAND AGAINST HIM

Licthman’s texts to his client were more than flirty. The married lawyer told her what he was thinking when looking at her pictures, and even looking at her in court.

“Do you want to belong to me? Will it be ok if some days I just use your body…” he wrote in one text.

In another, he texted: “You do look so pretty in that pic I would like to foul you. Is it bad that I’m thinking some disgusting thoughts about you?”

Melngailis did not discourage him. She responded: “Is it bad that Iʼm glad youʼre thinking them?” About a week later, Lichtman upped the ante.

“We need to do this soon,” he texted. “Would you still be able to stand me as your lawyer if I foul you?”

“I think so,” Melngailis texted back. “Let’s wait until after then,” Lichtman said.

AUDIO OF EL CHAPO TELLING UNDERLINGS HOW TO DEAL WITH COPS HEARD IN COURT

The revelation of the texts threatened to upend things at the drug lord’s trial. For one thing, mixing legal briefs and cotton briefs is a no-no in the code of professional responsibility, the Post noted.

The New York State Bar Association’s code forbids a lawyer to “require or demand sexual relations with a client or third party incident to … any professional representation,” or “employ coercion, intimidation, or undue influence in entering into sexual relations with a client.”

“The idea that someone would have a sexual relationship with a client is absurd,” the Post quoted an unidentified attorney as saying.

Lichtman also told his paramour that she was distracting him from the drug lord’s case. He said, according to the Post, that he was “spending more time on your case than on the one where I got paid a million dollars.”

If that unsettled El Chapo, he didn't show it on Monday.

The former kingpin entered the courtroom with a big smile, greating his team and making it a point to shake hands with Lichtman. El Chapo then gave him a thumbs up, and Lichtman responded in kind.

The coverage of the affair concerned attorneys in the case, prompting Judge Brian Cogan to check to see if the jurors had caught wind of it. “The attorneys wanted me to inquire of the jury on the record privately to see if any of them had been exposed or if anyone had seen or heard of the article in question,” Cogan said.

After speaking to the jurors, Cogan said he received a “unanimous adamant, ‘What are you talking about, judge?'”

Lichtman evidently told his mistress that he had separated from his wife, which came as a surprise to his wife, who denied it to the Post.

His wife added that she was unaware of an affair.

The newspaper said that Melngailis did not return their messages seeking a comment. For his part, Lichtman told The Post he is not a perfect human being.

“This is a deeply personal matter that I’m going to try to deal with privately,” The Post quoted him as saying. “My life and behavior have not always been perfect — as I think we can all say — but I’m proud of my legal work in this case and on behalf of all the clients I’ve represented for the past 28 years. My personal feelings have never impacted my professional work or the results that I have achieved.”

Marta Dhanis is a Fox News producer. The Associated Press contributed to this report.