CNN’s Jim Acosta walks into federal court in Washington to attend a hearing on a legal challenge against the Trump administration. (Manuel Balce Ceneta/AP)

Lawyers for President Trump and CNN squared off in federal court Wednesday in legal arguments over whether the president has the power to revoke the White House press credential of reporter Jim Acosta.

The judge overseeing a lawsuit brought by CNN said he would decide by Thursday afternoon whether to grant CNN’s motion for a restraining order that would temporarily restore Acosta’s access to the White House.

Wednesday’s skirmish in U.S. District Court in Washington was the first since CNN filed its suit Tuesday. The news network did so after White House press secretary Sarah Sanders yanked the reporter’s access to the White House grounds after he engaged in a contentious exchange with Trump during a news conference and briefly tangled with a press aide.

Precisely who made the decision to bar Acosta was unclear at Wednesday’s hearing. Justice Department attorney James Burnham, representing the White House, said he didn’t know who made that call when asked by U.S. District Judge Timothy J. Kelly.

Burnham argued, however, that the president could exclude any reporter from the White House’s grounds, just as he has the right to exclude them from interviews in the Oval Office or to ignore their questions during news conferences.

“I don’t think anyone would dispute, if [Trump] wants to exclude all reporters from the White House grounds, he clearly has the authority to do that,” Burnham argued at one point during the 110-minute hearing. “There’s no First Amendment right . . . for journalists to be there.”

He also argued that CNN’s and Acosta’s First Amendment rights weren’t injured by the decision to exclude Acosta — as CNN contends — because the network has dozens of other journalists with White House passes who could report in his place. He also said Acosta was free to keep reporting on Trump by watching television coverage of him outside the White House gates.

That brought a sharp reply from CNN lawyer Ted Boutrous, who said the government had “a warped view” of journalism and due process. CNN’s lawsuit contends that Trump’s actions violate both the First Amendment and the Fifth Amendment, which ensures that government actions are guided by clear procedure, not arbitrary action.

“The government’s now taking the position that [the president] can do anything he wants,” Boutrous said.

The White House took the unprecedented step of lifting Acosta’s credential after Trump blasted him as “a rude, terrible person” when the reporter questioned him during a news conference.

CNN and Acosta have gotten support from mainstream news organizations, which said Wednesday they would jointly file friend-of-the-court briefs on CNN’s behalf. The organizations included The Washington Post, the New York Times, Fox News, NBC News, the Associated Press, Bloomberg and others.

“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,” lawyers for the group said in a statement. “It is imperative that independent journalists have access to the president and his activities, and that journalists are not barred for arbitrary reasons. Our news organizations support the fundamental constitutional right to question this president, or any president.”

In a separate statement, Fox News President Jay Wallace said: “Fox News supports CNN in its legal effort to regain its White House reporter’s press credential. . . . Secret Service passes for working White House journalists should never be weaponized. 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.”