(CNN) CNN's Jim Acosta has returned to his post at the White House following a court ruling that forced the Trump administration to reinstate his press pass.

Now President Trump is vowing to create "rules and regulations" for how White House reporters act. He says "you have to practice decorum" at the White House.

"It's not a big deal," Trump told Fox News in an interview on Friday. "What they said, though, is that we have to create rules and regulations for conduct, etcetera. We're going to write them up. It's not a big deal. If he misbehaves, we'll throw him out or we'll stop the news conference."

Friday's ruling by federal judge Timothy J. Kelly was an initial victory for CNN in its lawsuit against Trump and several top aides . The suit alleges that CNN and Acosta's First and Fifth Amendment rights were violated by last week's suspension of his press pass.

Kelly did not rule on the underlying case on Friday. But he granted CNN's request for a temporary restraining order on Fifth Amendment grounds. And he said he believes that CNN and Acosta are likely to prevail in the case overall.

"Let's go back to work," Acosta said in brief comments outside the courthouse.

Later in the day he arrived at the White House and received his Secret Service "hard pass," the pass that was taken from him nine days ago.

He is expected to appear on CNN for one of his usual live shots on Friday evening.

CNN v. Trump is an important test of press freedom in the US. Kelly, seemingly well aware of the high stakes, read his written opinion from the bench for nearly 20 minutes Friday morning. He sided with CNN on the basis of the suit's Fifth Amendment claims, saying the White House did not provide Acosta with the due process required to legally revoke his press pass.

He left open the possibility that the White House could seek to revoke Acosta's pass again if it provided due process.

That may be why Trump is talking about implementing "rules."

Kelly went to great lengths to explain what his decision meant — and what it didn't mean — to the attentive audience. He emphasized the "very limited" nature of the ruling. He said that while he may not agree with the underlying case law that CNN's argument was based on, he had to follow it. "I've read the case closely," he said. "Whether it's what I agree with, that's a different story. But I must apply precedent as I see it."

Kelly criticized last week's blacklisting of Acosta as "shrouded in mystery," noting that the Justice Department lawyer in the case couldn't even say who ordered the decision.

But he also said that he was not making a judgment on the First Amendment claims that CNN and Acosta have made.

Despite that, Sanders said in her statement, "Today, the court made clear that there is no absolute First Amendment right to access the White House."

The judge did not make that clear.

But he did note that Sanders' initial claim that Acosta had inappropriately touched a White House intern was "likely untrue" and "partly based on evidence of questionable accuracy." Acosta held onto a microphone when an intern tried to take it away during a presidential news conference last week. Later that day, the correspondent's access to the White House was suspended.

Kelly noted that Trump may never call on Acosta again. But that's not relevant to this decision, he said. There needs to be due process regarding the pass.

Kelly was appointed to the bench by Trump last year, and confirmed with bipartisan support in the Senate. CNN chief legal analyst Jeffrey Toobin said the ruling "strikes me as an extremely savvy and wise resolution of this case."

Press Secretary Sarah Sanders, one of the six defendants in the case, did not specify whether the administration would continue to fight the lawsuit in court. The legal battle may continue for months.

But Sanders said in a statement that "we will also further develop rules and processes to ensure fair and orderly press conferences in the future. There must be decorum at the White House."

Trump said the same thing during a Q&A with reporters in the Oval Office.

"People have to behave," he said, when asked about the administration's defeat in court.

"If they," meaning reporters like Acosta, "don't listen to the rules and regulations, we'll end up back in court and we'll win. But more importantly, we'll just leave," meaning, stop taking questions from the press. "And then you won't be very happy. Because we do get good ratings."

Ted Boutrous, one of the outside lawyers representing CNN in the case, said in an interview that the network is open to a resolution that could avoid further legal action.

"We want to just simply move forward and let CNN and Jim Acosta gather news and report it," Boutrous said.

But what if the administration tries to implement intense restrictions on the press corps, or tries to revoke other press passes?

"I think, you know, we're ready to litigate as long as we have to to protect these First Amendment rights, to ask the court to declare rules of the road going forward," Boutrous said.

In a statement about the ruling, CNN said, "We are gratified with this result and we look forward to a full resolution in the coming days. Our sincere thanks to all who have supported not just CNN, but a free, strong and independent American press."

Numerous press freedom advocacy groups also cheered the ruling.

"Today, a major precedent was set for the future of a free press. It is a win for one reporter, but most importantly a win for the Constitution and the enduring freedoms it grants us all," the Georgetown Law's Institute for Constitutional Advocacy and Protection said.

And the ACLU said "the White House surely hoped that expelling a reporter would deter forceful questioning, but the court's ruling will have the opposite effect."

Most of the country's major news organizations have supported CNN's lawsuit , recognizing that the White House may try to ban other reporters in the future.

CNN has asked the court for "permanent relief," meaning a declaration from the judge that Trump's revocation of Acosta's press pass was unconstitutional. This legal conclusion could protect other reporters from retaliation by the administration.

But the judge will rule on all of that later. Further hearings are likely to take place in the next few weeks, according to CNN's lawyers.

The White House took the unprecedented step of suspending Acosta's access after he had a combative exchange with Trump at last week's post-midterms press conference. CNN privately sought a resolution for several days before filing suit on Tuesday.

The defendants include Trump, Sanders, and chief of staff John Kelly.

Judge Kelly heard oral arguments from both sides on Wednesday afternoon. Kelly asked tough questions of both sides, drilling particularly deep into some of CNN's arguments.

Then he said he would issue a ruling Thursday afternoon. He later postponed it until Friday morning , leaving both sides wondering about the reason for the delay.

In public, the White House continued to argue that Acosta deserves to be blacklisted because he was too aggressive at the press conference.

Speaking with Robert Costa at a Washington Post Live event on Thursday, White House communications official Mercedes Schlapp said press conferences have a "certain decorum," and suggested that Acosta violated that. "In that particular incident, we weren't going to tolerate the bad behavior of this one reporter," she said. Schlapp repeated the "bad behavior" claim several times.

When Costa asked if the White House is considering yanking other press passes. Schlapp said "I'm not going to get into any internal deliberations that are happening."

In court on Wednesday, Justice Department lawyer James Burnham argued that the Trump White House has the legal right to kick out any reporter at any time for any reason — a position that is a dramatic break from decades of tradition.

While responding to a hypothetical from Kelly, Burnham said that it would be perfectly legal for the White House to revoke a journalist's press pass if it didn't agree with their reporting. "As a matter of law... yes," he said.

The White House Correspondents' Association — which represents reporters from scores of different outlets — said the government's stance is "wrong" and "dangerous."

"Simply stated," the association's lawyers wrote in a brief on Thursday, "if the President were to have the absolute discretion to strip a correspondent of a hard pass, the chilling effect would be severe and the First Amendment protections afforded journalists to gather and report news on the activities on the President would be largely eviscerated."

On Friday the correspondents' association welcomed Kelly's ruling and said "we thank all of the news outlets and individual reporters who stood up in recent days for the vital role a free and independent news media plays in our republic."