Michael Avenatti is free to to keep talking.

A federal judge has rejected a request by former Trump lawyer Michael Cohen to issue a gag order on porn star Stormy Daniel's attorney.

Daniels is suing Trump and Cohen over a nondisclosure agreement related to her alleged affair in 2006 with the president. Judge S. James Otero's ruling means Avenatti, who is one of the most visible and vocal foes of Trump and Cohen, will get to keep up a blistering fusillade of criticism in what is now a multifront legal war against the president and his former attorney.

Tweet

The ruling came Tuesday in U.S. District Court in Los Angeles, where Daniels is seeking to be released from her hush-money deal with Cohen and Trump. She is also suing Trump for allegedly defaming her. The president called her claim that she was threatened by someone who mentioned Trump a "con job."

Cohen's lawyers had argued that Avenatti's more than 170 TV appearances and 439 public tweets about the facts and circumstances of the case created a risk of prejudice against Trump's former personal attorney.

Cohen had paid Daniels $130,000 on the eve of the 2016 presidential election for her agreement to keep mum about Trump.

Otero said he shared concerns expressed by another judge "about the extent and manner of Mr. Avenatti's publicity tour." But he also said Cohen had failed to describe how publicity sought by Avenatti "would affect his right to a fair trial in this action," where no trial date has even been set yet.

"It is far from clear that the publicity in this case would affect the outcome of a trial that may happen, if at all, months down the road," the judge wrote.

Otero also noted that the Supreme Court "has made clear that prior restraints" on a person's free speech "are the most serious and least tolerable infringement on First Amendment rights."

The judge also noted that Cohen was seeking a gag order against only Avenatti, which would "plausibly" bar Avenatti "from commenting on matters that are not substantially likely to have a materially prejudicial effect on these proceedings."

Avenatti told CNBC on Wednesday that, "We are pleased that the court saw the request for what it was — an attempt to silence me and prevent me from speaking the truth to the public."

Cohen's lawyer Brent Blakely declined to comment.

The White House has denied that Trump had sex with Daniels, whose real name is Stephanie Clifford. The White House likewise has denied that Trump had an affair with another woman, Playboy model Karen McDougal. McDougal received a payment in 2016 from the publisher of The National Enquirer for her story about the alleged trysts, but the tabloid never ran an article about her claims.

The payments to both women are being eyed by federal prosecutors in New York who are investigating the 51-year-old Cohen. Evidence related to both payments were seized from Cohen's files in April during a raid on his residences and office by the FBI.

Prosecutors are looking at the question of whether the payments to Daniels and McDougal violated federal election law. Cohen has not been charged in that case.

Avenatti, meanwhile, has used court hearings related to the probe, as well as another events linked to the investigation, as opportunities to blast Trump and Cohen.

In June, New York federal Judge Kimba Wood, who is overseeing matters related to the items seized from Cohen, told Avenatti that if she admitted him to argue at further court proceedings in the case "you would have to stop doing some of the things you have been doing."

"If you participate here, you would not be able to declare your opinion on Mr. Cohen's guilt, which you did. You would would not be able to give publicity to documents that are not public," Wood said. "It would change your conduct."

Avenatti, in the face of those comments, withdrew his request to be admitted into the case.