A federal judge excoriated the lawyer for former porn star Stormy Daniels on Wednesday, warning him that his attacks against President Trump's personal attorney, Michael Cohen, could impact Cohen's right to a fair trial.

During a tense one-hour hearing Wednesday morning, U.S. District Judge Kimba Wood noted that the proceedings may be a precursor to a criminal trial "if charges are filed against Mr. Cohen," and that attorney Michael Avenatti would need to choose between his "publicity tour" on various television networks, or the court case.

It appears the judge told @MichaelAvenatti he could represent his client in court or he could continue his daily appearances on CNN and MSNBC, but he could not do both. Guess which one he chose? — Byron York (@ByronYork) May 30, 2018

“I either want you to participate, or not be in the matter at all,” Wood told Avenatti. “I don’t want you to have some existence in a limbo where you’re free to denigrate Mr. Cohen, and I believe potentially deprive him of a fair trial by tainting a jury pool. … This conduct is inimicable to giving Mr. Cohen eventually a fair trial.”

Judge Wood told @MichaelAvenatti today she wouldn't agree to his motion to intervene in Cohen's case if he's planning to continue his stream of inflammatory press conferences & TV interviews. Faced with that choice… Avenatti withdrew his motion. #Kugel https://t.co/33Iejiakt9 pic.twitter.com/1FBZaVEg9h — Ira Goldman 🦆🦆🦆 (@KDbyProxy) May 30, 2018

In case you missed it, Michael Avenatti withdraw his pro hac vice motion. pic.twitter.com/Efh8vMKh51 — Adam Klasfeld (@KlasfeldReports) May 30, 2018

Wood reminded Avenatti that at this point, he has no standing in the case. And Stephan Ryan, Cohen's attorney, vociferously opposed Avenatti's application to appear before the court. Avenatti's involvement in the case so far, Ryan argued, has "turned (it) on it's head." He called Avenatti's media appearances "reckless and improper" and reminded the court that Avenatti had released some of Cohen's bank records to the media -- a "premeditated drive-by shooting of [Cohen's] rights," Ryan told the court. Avenatti showed reporters records of hundreds of thousands of dollars in transactions between Cohen LLC Essential Consultants and companies including AT&T and Novartis. There is now a Treasury Inspector General investigation into Cohen's release of the Suspicious Activity Report (SAR), Ryan told the court. -CBS News

Avenatti called Ryan's assertions "quite the tale," however Judge Wood told him to stick a cork in it, and that there were certain "professional responsibilities" that attorneys in New York must adhere to - and that if he wished to continue with the case, he wouldn't be allowed to comment on Cohen on his "publicity tour."

Avenatti had filed a motion to intervene in Cohen's case, while the Wall Street Journal reported that his behavior has been "frustrating" federal prosecutors.

Citing people familiar with the matter, the Journal says that Avenatti has "slowed prosecutors' efforts" to speak with Clifford's former attorney to discuss a nondisclosure agreement over an alleged 2006 sexual encounter between Clifford and Trump.

Ms. Clifford has recently said she agreed to the $130,000 deal with Mr. Cohen in 2016 not for the money, but because she feared for her family’s safety. That fear, she said, was based on a threat she received from an unidentified man who told her to “leave Trump alone” when a magazine nearly published her story several years earlier. ... But in the communications sought by prosecutors, Ms. Clifford didn’t mention being threatened or fearing for her safety before making the deal with Mr. Cohen , according to people familiar with the situation. Rather, she was trying actively to sell her story to various outlets, these people say. Mr. Avenatti called that account “patently false,” and said Ms. Clifford spoke of the threat to many people before executing the hush agreement. -WSJ

Cohen is currently under criminal investigation over potential fraud and campaign-finance violations related to the payment of Clifford. On April 9 his home, office and hotel suite were raided by federal prosecutors at the request of special counsel Robert Mueller. Cohen has denied any wrongdoing and has not been charged with any crimes, while President Trump has denied having sex with Clifford.

Mr. Avenatti hasn’t yet acted on multiple requests from federal prosecutors in Manhattan for Ms. Clifford to waive the attorney-client privilege that prevents her former lawyer from discussing their communications about the nondisclosure deal, the people familiar with the matter said. In April, Mr. Avenatti, acting in his capacity as Ms. Clifford’s current lawyer, sent a cease-and-desist letter to her former lawyer, Keith Davidson, ordering him not to disclose any communications related to her, one of those people said. Mr. Avenatti made similar demands of Ms. Clifford’s former manager, Gina Rodriguez, who helped engineer the hush-money deal. Mr. Avenatti tried to block Ms. Rodriguez from providing her communications with Ms. Clifford to federal prosecutors until he had reviewed them , other people familiar with the matter said. -WSJ

Avenatti claims that a reporter was shown audio recordings released by Cohen which reportedly contain several conversations with Davidson regarding Clifford, which Avenatti says has compromised her attorney-client privilege.

He said that the existence of the recordings was "surprising and disturbing."

Following the hearing, Avenatti told reporters that the Wednesday proceedings revealed that "just like Nixon tapes years ago, we now have what I will refer to as 'the Trump tapes," and that Ryan "admitted that there are audio recordings that Michael Cohen was taking for years, and that those recordings are, to quote him 'not only do they exist, but they are under lock and key,' and some of them relate to my client and her attorney-client privilege communications."

Avenatti has called on Ryan to release the recordings.