A federal judge ruled today that the White House must return CNN reporter Jim Acosta's press pass, at least for the time being.

Judge Timothy J. Kelly of the U.S. District Court for the District of Columbia says the White House does not have to allow reporters onto the White House grounds. However, he notes First Amendment issues can arise if the administration allows some reporters on the grounds but not others, according to Buzzfeed News reporter Pat McLeod. Kelly also says Acosta was not provided due process when the White House decided to revoke his pass.

Ultimately, Kelly says CNN successfully proved it will suffer irreparable harm as a result of the administration taking away Acosta's pass. "I will order defendants immediately restore Mr. Acosta's hard pass," Kelly says.

Kelly's ruling came a little more than a week after a contentious exchange between Trump and Acosta. At Trump's post-midterms press conference, Acosta pressed the president on his characterization of the migrant caravan as an "invasion." Trump responded: "I think you should let me run the country, you run CNN," adding: "And if you did it well, your ratings would be much better."

Acosta attempted to ask another question, but Trump wouldn't answer. When a White House intern tried to take the mic away from Acosta, he continued to hold onto it. Later, White House Press Secretary Sarah Huckabee Sanders accused Acosta of "placing his hands" on the intern, which he clearly didn't do. The White House then revoked Acosta's press pass, prompting an uproar from the media.

On Tuesday, CNN filed a lawsuit against Trump and some of his top aides, in an effort to make the White House give Acosta his pass back. The network received the support of multiple other news organizations, including Fox News, in the form of amicus briefs filed with the court.

CNN argues that taking away Acosta's pass violated his and the network's First and Fifth Amendment rights (freedom of the press and due process, respectively). Of particular issue is whether his pass was taken away because of his rude behavior or due to the content of his reporting.

In a statement on Tuesday, Sanders seemed to change the White House's justification. Though she originally cited Acosta's alleged physical behavior toward the intern, she now said he tried to "monopolize the floor" rather than "yield to other reporters."

That argument may have been on Judge Kelly's mind when he asked CNN's attorney, Theodore J. Boutrous Jr., why the White House would decide to take action against Acosta now. After all, the president has fueded with Acosta and CNN for a long time. "What triggered a content-based response here as opposed to all those other months?" Kelly asked, according to ABC News.

"This was a bad day for the president," Boutrous responded. "It was the day after the midterms." Boutrous also said that Acosta's alleged rudeness isn't the issue here. "Rudeness really is a code word for 'I don't like you being an aggressive reporter,'" he said, adding that it's actually Trump who "is the most aggressive, dare I say rude, person in the room, and I'm not being critical—this is the rough and tumble of the presidency, and that's what the First Amendment protects."

Justice Department lawyer James Burnham argued the White House has ultimate control over who attends its press conferences. CNN reports:

Burnham said that it would be perfectly legal for the White House to revoke a journalist's press pass if it didn't agree with their reporting. "As a matter of law…yes," he said.

That argument is somewhat troubling. The White House may be where Trump lives, but it's not his property. As Reason's Robby Soave argued last week, the administration should not be in the business of banishing reporters for being critical, even if those reporters are also rude or tend to hog the mic.

Kelly's ruling is only temporary. CNN had asked for "permanent relief" as well as "emergency relief," but today's decision only applies to the latter request. "I want to emphasize the very limited nature of today's ruling," Kelly says. Acosta has his pass back for now, but this saga is far from over.