Donald Trump's administration has been ordered to return, on a temporary basis, the press pass of CNN reporter Jim Acosta.
Mr Acosta, CNN's chief White House correspondent, said he "would like to get back to work" as he returned to the White House on Friday.
President Donald Trump said the White House is “writing up rules and regulations” for reporters, adding that “people have to behave".
Mr Acosta's clearance was revoked after a heated row with the president during a press conference after the mid-term elections.
Mr Trump branded Mr Acosta a "rude, terrible person" after he questioned the president's description of a Honduran migrant caravan as an "invasion".
During the exchange, a White House aide tried to take a microphone from Mr Acosta. The White House accused the reporter of "placing his hands on a young woman just trying to do her job". CNN and Mr Acosta said this was a lie.
US District Court Judge Timothy Kelly, an appointee of President Trump, announced his decision at a hearing on Friday morning.
Mr Acosta's credentials have been returned while a lawsuit over their revocation goes forward.
He said: "I just want to say that I'm very grateful for what happened today and grateful for my colleagues in the press who stood by us through all of this. This was a test. And you know I think we passed the test.
"Journalists need to know that in this country their First Amendment rights of freedom of the press are sacred. They're protected in our Constitution. And you know throughout all of this, I was confident and I felt that this would be the result at the end of the day that our rights would be protected to continue to cover our government and hold our leaders accountable."
White House press secretary Sarah Huckabee Sanders said they will "develop rules and processes to ensure fair and orderly press conferences in the future".
Speaking to reporters after the decision, Mr Trump said: "If they don't listen to the rules and regulations, we will end up back in court and we will win."
He added: "We want total freedom of the press. It's very important to me, more important to me than anybody would believe.
"But you have to act with respect when you're in the White House, and when I see the way some of my people get treated at press conferences, it's terrible. So we're setting up a certain standard, which is what the court is requesting."