CNN accused the Trump administration of violating constitutional rights of freedom of the press and due process.

A federal judge on Friday ruled to immediately reinstate CNN reporter Jim Acosta’s White House press credentials in a victory for the cable news network and the media outlets that are supporting its lawsuit.

CNN’s victory was in response to a temporary restraining order asking for the immediate restoration of Acosta’s press pass. Its broader lawsuit concerns whether the White House’s decision to revoke his press pass was unconstitutional.

U.S. District Judge Timothy J. Kelly, who was appointed by President Donald Trump last year, said CNN’s attorneys were likely to prevail in their argument that the White House had violated Acosta’s and the network’s First and Fifth Amendment rights.

Kelly said he did not decide whether the White House violated the First Amendment, relying primarily on the Fifth Amendment in saying that Acosta’s and CNN’s right to due process was likely violated because the White House process for revoking his press pass was “shrouded in mystery.”

The judge also cited the “irreparable harm” to Acosta. The White House had argued that CNN could simply send other reporters in Acosta’s place, yet Kelly argued that it “does not make the harm to Mr. Acosta any less real.”

Under the ruling, Acosta will temporarily receive his press pass back, while the full lawsuit proceeds.

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

CNN on Tuesday sued the Trump administration for confiscating Acosta’s “hard pass,” which grants White House press pool reporters access to the White House, following a spat between the president and Acosta during a post-midterm elections press conference last week.

In a hearing in federal court on Wednesday, Justice Department attorney James Burnham said the president has the authority to ban reporters from the White House, The Washington Post reported.