U.S. District Court Judge Timothy Kelly ruled Friday morning that the White House must immediately return CNN journalist Jim Acosta's press credentials taken away abruptly last week after a heated exchange between the US president and the CNN reporter. This is an "interim relief", not a final order but a big win for CNN which has repeatedly been attacked by US president Donald Trump as "Fake News". Reporters at the courthouse say the judge was succinct in his ruling and said in as many words that he is not granting CNN a "victory".

Trump loses CNN v. Trump because of a longstanding precedent — the government cannot restrict press access because it disagrees with what the press reports.

"Great day for journalism and the First Amendment!", said CNN's lawyers while Acosta emerged from the courthouse, thanked his colleagues in the media and the judge and then closed off with "let's get back to work!"

This does not mean the White House face off with the media or CNN in particular is going to wane. Since the judge's ruling Friday is only a temporary order, it leaves enough room for the White House to whip up a new set of rules that govern reporters' access and limits inside the White House grounds.

Kelly, a Trump appointee, took his decision after hearing arguments this week from lawyers representing CNN and the Justice Department. The news network was seeking an immediate restraining order that would force the White House to hand back Acosta's credentials, which grant reporters access into the 18-acre complex.

Acosta has clashed repeatedly with Trump and press secretary Sarah Huckabee Sanders in briefings over the last two years. But the dynamic devolved into a near-shouting match during a combative press conference last week following midterm elections in which Republicans lost control of the House.

A White House staff member tries to take the mic from CNN's Jim Acosta as he questions Donald Trump. Reuters

The judge said the government could not say who initially decided to revoke Acosta's hard pass. The White House had spelled out its reasons for revoking his credentials in a tweet from White House Press Secretary Sarah Huckabee Sanders and in a statement after CNN filed its lawsuit. But the judge said those "belated efforts were hardly sufficient to satisfy due process."

The judge also found that Acosta suffered "irreparable harm," dismissing the government's argument that CNNcould just send other reporters to cover the White House in Acosta's place.

The judge told attorneys to file additional court papers in the case by Monday.

At last week's press conference, which followed the midterm elections, Trump was taking questions from reporters and called on Acosta, who asked about Trump's statements about a caravan of migrants making its way to the U.S.-Mexico border. After a terse exchange, Trump told Acosta, "That's enough," several times while calling on another reporter.

Acosta attempted to ask another question about special counsel Robert Mueller's Russia investigation and initially declined to give up a hand-held microphone to a White House intern. Trump responded to Acosta by saying he wasn't concerned about the investigation, calling it a "hoax," and then criticized Acosta, calling him a "rude, terrible person."

The White House pulled Acosta's credentials hours later.

The White House's explanations for why it seized Acosta's credentials have shifted over the last week.

Sanders initially explained the decision by accusing Acosta of making improper physical contact with the intern seeking to grab the microphone.

But that rationale disappeared after witnesses backed Acosta's account that he was just trying to keep the microphone, and Sanders distributed a doctored video that made it appear Acosta was more aggressive than he actually was. On Tuesday, Sanders accused Acosta of being unprofessional by trying to dominate the questioning at the news conference.