CNN’s Jim Acosta gestures as he leaves federal court in Washington following a hearing on a legal challenge against President Donald Trump’s administration over the revocation of his White House “hard pass.”Manuel Balce Ceneta/AP

A federal judge on Friday ruled that the White House violated CNN reporter Jim Acosta’s Fifth Amendment rights when it revoked his press credential last week, and ordered the Trump administration to reinstate Acosta’s press pass “immediately.”

The decision comes after CNN filed a lawsuit on Tuesday against President Donald Trump and other senior White House officials, alleging that Trump infringed upon Acosta’s First and Fifth Amendment rights when it revoked Acosta’s hard pass following a contentious post-election news conference.

Judge Timothy J. Kelly — who was appointed by President Donald Trump — criticized how the White House handled the situation, saying that their decision to revoke Acosta’s credential was “so shrouded in mystery that the government could not tell me... who made the decision,” according to BuzzFeed News’ Paul McLeod.

The decision is a total win for CNN and other news organizations fighting for press freedoms.

Kelly rejected the argument the Justice Department made, saying that Trump “doesn’t need a reason” to revoke any reporter’s press because “there is no First Amendment protection.”

Kelly also criticized the White House’s changing story about why it revoked Acosta’s credential. Initially, the White House used doctored video footage to claim that Acosta put his hands on a White House intern, a claim Kelly said was of “questionable accuracy,” according to McLeod.

The White House also argued that CNN did not suffer harm because of Acosta’s revoked credential, given that they had other reporters who could still access the White House,” McLeod reported.

Kelly said that argument “does not make the harm to Mr. Acosta any less real.”

Trump, for his part, used the revocation of Acosta’s credential to raise money for his 2020 presidential bid, writing in a fundraising email, “President Trump will NOT put up with the media’s liberal bias and utter disrespect for this Administration and the hardworking Americans who stand with us.”

After the ruling, White House press secretary Sarah Huckabee Sanders said the White House will “temporarily reinstate” Acosta’s credentials, but did not say whether the administration will appeal the ruling.

“In response to the court, we will temporarily reinstate the reporter’s hard pass,” Sanders said. “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.”