A federal judge in California on Friday declined to immediately impose an order barring Stormy Daniels’ attorney from publicly sharing his opinions about the guilt of President Donald Trump’s personal attorney, Michael Cohen.

An attorney for Cohen, in a motion filed Thursday, sought to bar Daniels' lawyer Michael Avenatti from commenting on a civil case filed by Daniels, the adult film actress who is seeking to invalidate a non-disclosure agreement stemming from a sexual relationship she says she had with Trump over a decade ago.

The White House and Cohen have denied that Trump had an affair with Daniels, whose real name is Stephanie Clifford.

Judge S. James Otero of U.S. District Court in Los Angeles ruled that Cohen’s motion did not demonstrate “that immediate, irreparable injury" would occur without the gag order, and set a briefing schedule for late this month and early July, according to court documents.

Clifford is seeking to invalidate the non-disclosure agreement she signed in exchange for $130,000 paid by Cohen a month before the 2016 presidential election.

The motion filed by Cohen's attorney, Brent Blakely, claimed that Avenatti's frequent media appearances and tweets could deprive Cohen of his right to a fair trial in the civil case.

Former federal prosecutor and NBC News analyst Chuck Rosenberg said on MSNBC Friday that he agrees with the reasoning behind Cohen's motion.

"What Mr. Cohen was trying to do — and it makes sense to me — is to prevent people like Mr. Avenatti from talking publicly and often about a case in which Mr. Cohen is a party," Rosenberg said.

"Courts take very seriously the idea that everyone gets a fair trial. And so that's what Mr. Cohen was trying to achieve. I don't blame him, and I imagine the judge will eventually hear this on its merits," he said.

On Twitter Friday, Avenatti announced the judge’s order. Earlier Friday, he tweeted that “for over 12 yrs, Mr. Cohen and his boss Mr. Trump have routinely tried to 'shut people up' and hide the truth through intimidation & threats,” and that "the motion is right out of their playbook."

For over 12 yrs, Mr. Cohen and his boss Mr. Trump have routinely tried to “shut people up” and hide the truth through intimidation & threats. Reporters, judges, adversaries, attys. The motion is right out of their playbook. And their assault on the 1st Amendment continues. #Basta — Michael Avenatti (@MichaelAvenatti) June 15, 2018

A footnote in the judge’s Friday order says that orders like the kind sought "are solely for extraordinary relief and are discouraged," because ex parte applications, brought by one party to a legal matter without representation from the opposing party, "throw the system out of whack."