A judge on Friday ordered the White House to immediately restore the hard pass press credential of CNN White House Correspondent Jim Acosta after it was temporarily suspended following a tense exchange with President Donald Trump.

U.S. District Court Judge Timothy Kelly, citing the legal precedent from the 1977 D.C. Circuit Court case, Sherrill v. H. Knight, said the White House did not provide Acosta “due process” in revoking the pass. Kelly, a Trump appointee, made clear that the ruling was not based on whether the White House violated Acosta’s First Amendment rights. Rather, CNN and the White House correspondent demonstrated a likelihood of success in arguing that their Fifth Amendment rights to due process were breached, the judge said.

Further, the judge stated the fact that CNN has other pass holders does not reduce the level of “harm” towards the network’s White House correspondent. The judge also remarked on Acosta “laying hands” on a White House intern, calling the characterization “likely untrue” and “partly based on evidence of questionable accuracy.”

Notably, Kelly, referring to his ruling as “very limited” in nature, left the door open for the White House to revoke Acosta’s credentials, granted due process is respected.

“I just want to say something very briefly and that is I want to thank all of my colleagues in the press who supported us this week and I want to thank the judge for the decision he made today. Let’s get back to work,” Acosta said as he exited the courthouse.

CNN reporter Jim Acosta says "let's go back to work" after a federal judge orders the Trump White House to immediately restore his press pass. https://t.co/vghji3CxHs pic.twitter.com/I4pD7vWgDt — ABC News (@ABC) November 16, 2018

CNN attorney Ted Boutros said the news network is “extremely pleased with the ruling today,” adding that it is “a great day for the First Amendment and journalism.”

In a separate statement, 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.”

Responding to the ruling, the White House announced it will “temporarily reinstate” Acosta’s pass and said it will “further develop rules and processes to ensure fair and orderly press conferences in the future.”

.@PressSec issues statement in response to judge ruling that White House has to reinstate CNN reporter Jim Acosta's hard pass: “Today, the court made clear that there is no absolute First Amendment right to access the White House." https://t.co/kyAJcV3Zgr pic.twitter.com/2Y7RqW1eY6 — CBS News (@CBSNews) November 16, 2018

On Thursday, Kelly delayed his decision on whether to order the Trump administration to return the White House press credentials of Acosta.

Kelly heard arguments Wednesday 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 President Trump and press secretary Sarah Huckabee Sanders in briefings over the last two years. However, 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.

Acosta refused to give up a microphone when the president said he didn’t want to hear anything more from him. President Trump referred to Acosta a “rude, terrible person.”

Hours later, The White House announced that Acosta’s White House access would be revoked.

The CNN lawsuit called the revocation “an unabashed attempt to censor the press and exclude reporters from the White House who challenge and dispute the President’s point of view.”

Justice Department lawyer James Burnham argued that Acosta was guilty of “inappropriate grandstanding” and deserved to lose his access over “his refusal to comply with the general standards of a press conference.”

Burnham said that the White House is essentially President Trump’s home and office and that he has some right to decide who can and can’t be there. “There’s no First Amendment right to access the White House grounds,” Burnham said. Further, Burnham also pointed out that CNN has dozens of other staffers with White House credentials, so excluding Acosta would not harm the network’s coverage.

The network’s lawyer, Theodore Boutrous, contended that Acosta was being singled out for his White House coverage, not his alleged rudeness during a news conference.

“The White House has made very clear that they don’t like the content of the reporting by CNN and Jim Acosta,” Boutrous said. “Rudeness really is a code word for ‘I don’t like you being an aggressive reporter.’”

President Trump, in an interview published Wednesday, told The Daily Caller that “guys like Acosta” were “bad for the country. … He’s just an average guy who’s a grandstander who’s got the guts to stand up and shout.”

A number of news organizations, including Fox News, CBS News, and NBC, announced their intention to file amicus briefs with the court in support of CNN. One American News announced Thursday it would file a brief in support of the White House.

The Associated Press contributed to this report.