UPDATE: ?A federal judge ordered the Trump administration on Friday to immediately return, on a temporary basis, the press pass of CNN reporter Jim Acosta, who was barred from the White House after last week's contentious televised news conference.

The order to restore Acosta's access came from Judge Timothy Kelly, appointed a year ago to the federal district court in Washington, D.C., by President Donald Trump. He said the White House must give the credential back temporarily in order to give Acosta a chance to persuade the administration that he should be allowed to keep it.

The White House suspended Acosta's press credential shortly after the November 7 news conference. Press Secretary Sarah Huckabee Sanders said she acted because he refused to surrender the microphone handed to reporters asking questions of the president. Her statement accused him of "placing his hands" on a White House intern who tried to take the microphone back. Acosta's conduct, she said, was "absolutely unacceptable."

CNN filed a lawsuit Tuesday against President Trump, Sanders, and other officials, accusing them of violating the First Amendment rights of CNN and Acosta to report on the presidency. "This severe and unprecedented punishment is the culmination of years of hostility by President Trump against CNN and Acosta based on the contents of their reporting," CNN's lawyers said.

The judge said the White House denied Acosta due process by suspending his credential with no notice, but the judge did not rule on the First Amendment issues which were at the heart of the case.

Courts have long held that the government cannot discriminate against disfavored points of view.

Suspending Acosta's press pass, which gives him access to the White House and his office in the building, is "an unabashed attempt to censor the press and exclude reporters from the White House who challenge and dispute the president's point of view," the lawsuit said.

Several other news organizations, including the AP, Fox News, NBC News, the New York Times, and the Washington Post supported CNN. "Reporters covering the White House must remain free to ask questions. It is imperative that independent journalists have access to the President and his activities and that journalists are not barred for arbitrary reasons," they said in a joint statement.

But the Justice Department told the judge that Acosta's press pass was suspended because he "disrupted the fair and orderly administration of a press conference." The government's legal brief abandoned the claim in the Sanders statement that Acosta placed his hands on the White House intern.

As for the First Amendment issue, the government said presidents have the same discretion to regulate access to the White House as they do to select which journalists get interviews or which reporters they call on at news conferences.

The government lawyers said there's general right for the public or the press to enter the White House, and the First Amendment is not violated when a president exercises discretion to deny access to any of the hundreds of journalists who seek entry to the White House complex. Besides, the Justice Department said, roughly 50 other CNN employees already have White House press passes.

Last week's televised exchange was particularly testy. When Acosta tried to ask a follow-up question, President Trump said, "CNN should be ashamed of itself, having you work for them. You are a rude, terrible person." But the White House response appears to be the first time a reporter's press credential was suspended because of a journalist's demeanor.

PREVIOUS STORY: President Donald Trump's ongoing feud with Jim Acosta, CNN's chief White House correspondent, boiled over on Wednesday, with Trump calling Acosta "a rude, terrible person" as he tried to ask the president a question.

The exchange came during a White House press conference on the 2018 midterm elections, in which Trump called out failed Republican candidates who didn't "embrace" him.

Trump began taking questions and called on Acosta, who tried to ask about the president's characterization of a migrant caravan of roughly 4,000 Central American immigrants who are walking through Mexico to claim asylum in the U.S.

Trump immediately interrupted Acosta as the journalist began to ask his question. "Here we go," Trump said to Acosta.

Acosta then challenged Trump's use of the word "invasion" to describe the caravan and asked the president if he thought he had demonized immigrants. Trump then said he wanted immigrants to "come in legally."

When the president tried to go to another journalist, Acosta declined to give up the microphone and asked about possible indictments by special counsel Robert Mueller based on the ongoing investigation into Trump's presidential campaign.

Trump told Acosta to "put down the mic" and a White House staffer tried to take the microphone from the CNN correspondent but he wouldn't give it up.

Acosta finally relinquished the mic and sat down, but Trump then began to verbally berate him from the lectern.

"CNN should be ashamed of itself having you working for them," Trump said. "You are a rude, terrible person. You shouldn't be working for CNN."

Trump added that the way Acosta had treated Press Secretary Sarah Sanders was "awful."

The president then moved to address the next questioner, NBC News White House correspondent Peter Alexander, who defended Acosta.

"In Jim's defense, I've traveled with him and watched him, he's a diligent reporter who busts his butt like the rest of us," Alexander said.

"Well I'm not a big fan of yours either," Trump said.

Acosta then stood up and began speaking to the president off microphone, to which the president responded, "When you report fake news, which CNN does a lot, you are the enemy of the people."

Acosta later tweeted his thanks to Alexander.

Later in the news conference, Yamiche Alcindor, White House correspondent for PBS, asked the president about labeling himself a nationalist and whether he felt that emboldened white nationalists.

"I don't know why you'd say that," Trump said. "That's such a racist question."

Judy Woodruff, anchor and managing editors of PBS NewsHour, tweeted her support for Alcindor.

"My @NewsHour colleague @Yamiche is a complete professional, an utterly fair and hardworking reporter, Woodruff wrote. "She did not ask a 'racist question.'"

Alcindor later tweeted, "I'm simply asking the question the public wants to know."

"I followed up the president calling my question 'racist' with a policy question about his proposed middle-class tax cut because that's what journalists do," Alcindor, who is black, said in another tweet. "We press on. We focus on the privilege of asking questions for a living. We do the work."

Trump also repeatedly told April Ryan, White House correspondent for American Urban Radio Networks, to sit down, adding that "it's such a hostile media."

The news conference lasted almost an hour and a half, making it one of the longest of Trump's presidency.

CNN released a statement through its public relations Twitter account addressing the exchange with Acosta.

"This President's ongoing attacks on the press have gone too far," the company said. "They are not only dangerous, they are disturbingly un-American. While President Trump has made it clear he does not respect a free press, he has a sworn obligation to protect it. A free press is vital to democracy, and we stand behind Jim Acosta and his fellow journalists everywhere."

Ronna McDaniel, the chairwoman of the Republican National Committee, criticized Acosta for his part in the exchange.

"We all value a free press, but it’s unfortunate that some reporters seem more interested in getting their own cable show than doing their jobs," McDaniel said in a statement. "The media grandstanding has gone overboard.

Trump and Acosta have sparred before, with the CNN journalist having emerged as one of the president's favorite personal targets for his broader criticism of the media. In July, Trump declined to take a question from Acosta during a press conference with British Prime Minister Theresa May.

"CNN is fake news," Trump said. "I don't take questions from CNN."