A federal judge on Friday granted CNN's request for a court order that would temporarily reinstate network correspondent Jim Acosta's White House press pass, which had been suspended indefinitely in the wake of a fiery exchange between the reporter and President Donald Trump a week earlier.
The ruling from Judge Timothy Kelly, who was appointed by Trump, gave CNN a victory in the ongoing case.
"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," Acosta said outside U.S. District Court in Washington, D.C.
"Let's go back to work!" he added.
In a statement later on Friday, White House press secretary Sarah Huckabee Sanders said the Trump administration will return Acosta's pass.
"Today, the court made clear that there is no absolute First Amendment right to access the White House. In response to the court, we will temporarily reinstate the reporter's hard pass. We will also further develop rules and processes to ensure fair and orderly press conferences in the future," Sanders said. "There must be decorum at the White House."
Trump said the White House was already drafting rules of conduct during an interview with Fox News' Chris Wallace later Friday. Asked about the judge's ruling on Acosta, Trump said, "It's not a big deal and if he misbehaves, we'll throw him out or we'll stop the news conference."
The president also claimed he was a firm believer in press freedom, but said he will shut down future press interactions if a reporter is "acting out of sorts."
"I will say this, look, nobody believes in the First Amendment more than I do and if I think somebody is acting out of sorts I will leave. I will say thank you very much everybody, I appreciate you coming and I'll leave," Trump told Wallace.
CNN's lawsuit, announced Tuesday, argues that Acosta's constitutional rights had been violated by Trump and five other members of his administration, as well as by the U.S. Secret Service. The other defendants include Sanders, chief of staff John Kelly, deputy chief of staff Bill Shine and Secret Service Director Randolph Alles.
In a statement, CNN and Acosta said they "look forward to a full resolution in the coming days."
The legal challenge came in response to the Trump administration's decision last week to yank Acosta's "hard pass," which gave him access to the White House grounds, after Acosta clashed with the president at a news conference earlier that same day. The suit underscored Trump's increasingly hostile relationship with many mainstream media outlets, which he regularly decries as "fake news" and "the enemy of the people."
CNN had sought a resolution behind the scenes for several days before filing suit against the White House, according to the network.
The network had argued that the White House infringed on Acosta's free press and due process rights under the First and Fifth amendments to the U.S. Constitution. CNN was asking for an order that would temporarily reverse the White House's suspension of Acosta's hard pass, until a final decision on the lawsuit was reached. CNN also wants "a declaration that the revocation of Acosta's press credentials was unconstitutional."
Kelly granted CNN's request for a temporary restraining order, ruling that the White House had violated Acosta's due process. He ordered both parties to file a joint status report next week on how to proceed in the case.
CNN asked the judge to quickly rule on the request for a temporary restraining order, arguing that "every day that passes without Acosta regaining his press credentials is a concrete injury."
Justice Department lawyers replied in a court filing that suspending the pass was "lawful" and that the White House held "broad discretion to regulate" journalists' access to the grounds.
Acosta has often used stark language to challenge the White House on its policies. At the most recent White House press briefing on Oct. 29, Acosta grilled Sanders on Trump's use of the phrase "enemy of the people" to describe the media.
"If you're going to stand there and continue to say there are some journalists and news outlets in this country that meet that characterization, shouldn't you have the guts, Sarah, to state which outlets, which journalists are the enemy of the people?" Acosta asked.
Trump has specifically targeted both CNN and Acosta for their coverage of him and his presidency. In January 2017, Trump, who was then president-elect, tore into Acosta at a news conference, saying "your organization is terrible" and "you are fake news."
The rift between Acosta and the White House widened substantially at a Nov. 7 news conference the day after the midterm elections, where Trump claimed victory even after Democrats regained majority control of the House.
During a lengthy question-and-answer period, Acosta rebuked Trump for referring to a caravan of Central American migrants as an "invasion," and asked if the president thought he was demonizing immigrants.
Trump became visibly agitated with Acosta when the reporter continued asking follow-up questions after Trump tried to move on to other reporters. A female White House staffer walked up to Acosta and tried to snatch the microphone from his hand, but Acosta initially refused to give it up. "Pardon me, ma'am," Acosta said as he continued to question Trump.
"I think you should let me run the country. You run CNN. And if you did it well, your ratings would be much better," Trump told him at the time. "You are a rude, terrible person," the president added.
CNN's court filing notes that the White House's initial account of the incident — which was also its first justification for suspending Acosta's hard pass — was incorrect.
In a series of tweets Nov. 7, Sanders said the Trump administration will "never tolerate a reporter placing his hands on a young woman just trying to do her job as a White House intern."
Video footage of the event does not show Acosta putting his hands on the woman, who had walked up to him and reached across his torso to grab the microphone.
Sanders then released a video, reportedly sourced from right-wing conspiracy site Infowars, which The Washington Post and other outlets said was doctored. White House counselor Kellyanne Conway on Monday denied that the video had been altered, but said in the same interview that it had been "sped up."
Judge Kelly said in court Friday that the claim Acosta "laid hands" on the staffer was "likely untrue." The DOJ lawyers had declined to defend that statement in a prior court appearance Wednesday.
Two days after Acosta lost his hard pass, Trump appeared to undermine the White House's official justification for its action. Acosta "was not nice to that young woman," Trump said, but "I don't hold him for that because it wasn't overly, you know, horrible."
Sanders later softened her language, accused Acosta of having "physically refused" to give up the mic. The White House's court filing Wednesday only cited the more recent characterization.
In an interview with right-wing news site The Daily Caller published Wednesday, Trump said Acosta was "bad for the country," but said he wasn't certain if he would beat CNN in the lawsuit.
"Is it freedom of the press when somebody comes in and starts screaming questions and won't sit down?" Trump asked rhetorically.
CNN said in its legal challenge that the "pretextual and unabashed attempt to censor a reporter" viewed as a critic sets a chilling precedent. "It could be others also" who lose their press passes, Trump said Nov. 9.
"This is an important victory for press freedom," said Jameel Jaffer, executive director of the Knight First Amendment Institute at Columbia University. "We need reporters to be able to ask tough questions in these press briefings without having to fear that their access will be revoked as a result. The First Amendment forecloses the White House from selectively revoking access on the basis of a reporter's viewpoint."
A swath of major media organizations, including NBC News, The Washington Post and The New York Times came out in favor of CNN and Acosta.
"It is imperative that independent journalists have access to the President and his activities, and that journalists are not barred for arbitrary reasons," those outlets said in a joint statement. "Our news organizations support the fundamental constitutional right to question this President, or any President."
Fox News also came out publicly on CNN's side, to the surprise of some in the media. Trump has close friendships with many Fox personalities, especially right-wing commentator Sean Hannity, and regularly promotes the network's content.
"While we don't condone the growing antagonistic tone by both the president and the press at recent media avails, we do support a free press, access and open exchanges for the American people," Fox President Jay Wallace said in a statement.
But conservative cable network One America News Network, which has reportedly become one of Trump's favorites for its flattering coverage of his presidency, filed a supporting document in CNN's case Thursday night supporting the White House over a fellow media outlet.
Trump was "right on point" to call Acosta "rude" during the heated exchange at the news conference, OANN argued.
"While this narcissistic approach may serve Plaintiff's self-interests as entertainers or media figures and the network that profits therefrom, they do not serve the interests of the forum," OANN said.
— CNBC's Dan Mangan contributed to this report.