A judge ruled Friday that the White House must reinstate CNN reporter Jim Acosta’s press credentials after the news network filed suit earlier this week against President Donald Trump and his top aides.

U.S. District Court Judge Timothy J. Kelly granted CNN a temporary restraining order after determining that the White House likely violated Acosta’s right to due process when he was banned from the White House last week.

Update 1 p.m. EST Nov. 16: Speaking to reporters at the White House on Friday, Trump said officials are writing up rules and regulations for journalists to ensure proper decorum in the White House.

"You can't take three questions and four questions," he said. "You can't stand up and not sit down."

Trump spoke hours after Kelly determined that Acosta’s right to due process was likely violated by the White House’s decision to abruptly ban him last week.

"We want total freedom of the press," Trump said. "But you have to act with respect when you're at the White House, and when I see the way some of my people get treated at news conferences, it's terrible."

He said that if reporters fail to follow the yet-to-be written rules, “We'll end up back in court and we'll win, but most importantly, we'll just leave. And then you won't be very happy. Because we do get good ratings.”

Update 11:45 a.m. EST Nov. 16: The White House will reinstate Acosta's press pass after a judge ruled Friday that officials likely violated his right to due process last week when they abruptly barred him.

“In response to the court, we will temporarily reinstate the reporter’s hard pass,” White House press secretary Sarah Huckabee Sanders said in a statement. “We will also further develop rules and processes to ensure fair and orderly press conferences in the future.”

Huckabee Sanders said the court "made clear that there is no absolute First Amendment right to access the White House," though Kelly emphasized in court that his ruling did not address questions over whether Acosta's First Amendment rights had been violated, CNN reported.

“There must be decorum at the White House,” Huckabee Sanders added.

Acosta’s press credentials were revoked last week after he got into a heated back-and-forth with the president while questioning him over a caravan of migrants headed for the U.S. from Honduras.

Update 11:15 a.m. EST Nov. 16: CNN has formally requested that the White House return Acosta's press pass.

Update 10:55 a.m EST Nov. 16: In court Friday, Kelly noted that attorneys for the government could not say who made the initial decision to revoke Acosta's pass, The Associated Press reported.

Kelly found White House officials likely violated Acosta’s right to due process when they revoked his press credentials last week.

White House press secretary Sarah Huckabee Sanders accused Acosta in a statement released after the incident of “placing his hands on a young woman just trying to do her job as a White House intern.” She also shared video of the incident in question on Twitter.

Kelly said Friday that the "belated efforts were hardly sufficient to satisfy due process," according to the AP.

The judge also determined that the decision to bar Acosta from the White House caused him "irreparable harm" that was not lessened by the fact that other CNN reporters maintained their White House press passes, The Washington Post reported.

Kelly emphasized in court that his ruling was limited and did not address questions over whether Acosta's First Amendment rights had been violated, CNN reported.

He told attorneys to file additional court papers in the case by Monday, according to the AP.

Update 10:40 a.m. EST Nov. 16: "This is a great day for the First Amendment and journalism," CNN attorney Ted Boutrus said in a brief statement outside the courthouse Friday.

Acosta thanked other journalists who have thrown their support behind him and CNN as the case went to court. More than a dozen news organizations on Wednesday announced their intent to support CNN in the suit.

“Let’s get back to work,” Acosta said.

Update 10:30 a.m. EST Nov. 16: U.S. District Court Judge Timothy J. Kelly ruled Friday that the White House must return Acosta's press credentials, according to CNN.

The decision came at a 10 a.m. hearing Friday after Kelly told the court CNN was likely to prove Acosta's credentials were revoked without proper due process, The Washington Post reported.

Update 8:45 a.m. EST Nov. 16: U.S. District Court Judge Timothy J. Kelly is set to rule Friday on CNN's request to have Acosta's press credentials reinstated.

Update 1:05 p.m. EST Nov. 15: A judge on Thursday delayed a scheduled ruling on the case, CNN's chief media correspondent Brian Stelter said, citing court records.

U.S. District Court Judge Timothy J. Kelly is scheduled to hand down his decision at 10 a.m. Friday on whether to grant a temporary restraining order in the case.

Update 5:40 p.m. EST Nov. 14: The judge in the CNN lawsuit against President Donald Trump and other administration officials over banning reporter Jim Acosta from the White House said he'll issue a ruling Thursday at 3 p.m., according to news outlets.

U.S. District Court Judge Timothy J. Kelly heard arguments from both sides in a two hour hearing Wednesday afternoon.

It’s the first hearing in CNN and Acosta’s federal lawsuit against Trump and other administration officials over the suspension of Acosta’s White House press pass.

The network and Acosta contend the suspension violated the First and Fifth Amendments.

The White House said in a Justice Department filing Wednesday that it has “broad discretion” to decide which journalists get permanent press passes.

Journalism advocates said that the White House position is a break with historical tradition, with past administrations granting press access to large and small news outlets, and that the Acosta suspension is an unprecedented step that could have a negative impact on journalism.

Update 12:05 p.m. EST Nov. 14: In a court filing Wednesday, the Justice Department argued, "No journalist has a First Amendment right to enter the White House," after CNN sued the Trump administration for revoking Acosta's press credentials, The Hill reported.

"The president and White House possess the same broad discretion to regulate access to the White House for journalists (and other members of the public) that they possess to select which journalists receive interviews, or which journalists they acknowledge at press conferences," attorneys said in the filing, according to The Hill.

Attorneys for CNN filed suit Tuesday in U.S. District Court in Washington. A judge scheduled a hearing in the case for 3 p.m. Wednesday.

Update 11:45 a.m. EST Nov. 14: More than a dozen news organizations on Wednesday announced their intent to support CNN in the network's suit against the Trump administration.

"Whether the news of the day concerns national security, the economy, or the environment, reporters covering the White House must remain free to ask questions," officials from organizations including The Associated Press and The New York Times, said Wednesday in a joint statement.

"It is imperative that independent journalists have access to the President and his activities, and that journalists are not barred for arbitrary reasons."

Update 11:15 a.m. EST Nov. 14: Fox News plans to file an amicus brief in support of CNN in the news network's lawsuit against the Trump administration, Fox News president Jay Wallace said Wednesday in a statement.

"Secret Service passes for working White House journalists should never be weaponized," Wallace said. "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."

CNN filed suit against Trump and several officials Tuesday, days after reporter Jim Acosta had his press credentials revoked following a contentious exchange with the president.

White House press secretary Sarah Huckabee Sanders accused Acosta in a statement released after the incident of “placing his hands on a young woman just trying to do her job as a White House intern.”

Update 10:25 p.m. EST Nov. 13: A federal judge has given the Trump administration until 11 a.m. Wednesday morning to respond to CNN's lawsuit demanding a temporary restraining order in the battle over the White House's revocation of reporter Jim Acosta's press credentials, according to The Washington Post.

A hearing is scheduled for Wednesday afternoon in U.S. District Court in Washington.

CNN’s attorney said the network is considering whether to request financial damages in its claim against President Donald Trump.

Original report: In the lawsuit, filed in D.C. District Court, attorneys for CNN asked for Acosta's press credentials to be immediately reinstated and protected.

“While the suit is specific to CNN and Acosta, this could have happened to anyone,” CNN officials said in a statement. “If left unchallenged, the actions of the White House would create a dangerous chilling effect for any journalist who covers our elected officials.”

Attorneys for CNN named six defendants in the suit, including Trump, chief of staff John Kelly and White House press secretary Sarah Huckabee Sanders.

The lawsuit alleged the decision to revoke Acosta’s credentials was a “severe and unprecedented punishment” following “years of hostility by President Trump against CNN and Acosta based on the contents of their reporting.”

“(It’s) an unabashed attempt to censor the press and exclude reporters from the White House who challenge and dispute the President’s point of view,” CNN attorneys said in the lawsuit.

Acosta’s press credentials were suspended Wednesday after a White House intern attempted to take his microphone during a news conference with Trump. Huckabee Sanders released a statement after the incident accusing Acosta of “placing his hands on a young woman just trying to do her job as a White House intern.”