US District Judge Timothy Kelly, who is hearing CNN’s lawsuit challenging the revocation, ordered the White House to restore Acosta’s press pass while the case is pending.
He said there should be a due process in place for limiting a journalist’s access to the White House.
“Let’s go back to work,” Acosta said to reporters after the hearing.
CNN said in a statement it “looked forward to a full resolution in the coming days” and thanked “all who have supported not just CNN, but a free, strong and independent American press”.
Following the ruling, the White House said it would comply with the court order, and will “also further develop rules and processes to ensure fair and orderly press conferences in the future”.
Kelly did not address the First Amendment’s protections for freedom of speech and the press, but instead focused on due process provisions of the Constitution that provide for fair treatment through a judicial process.
The White House revoked Acosta’s credentials last week in an escalation of the Republican president’s attacks on the news media, which he has dubbed the “enemy of the people”.
In court, US government lawyers said there is no First Amendment right of access to the White House and that Acosta was penalised for acting rudely at the conference and not for his criticisms of the president.
At the press conference, which occurred a day after the US midterm elections, Trump dodged questions on a number of issues, including those about his role in contributing to the rise of white nationalism in the US.
When asked by CNN’s Acosta about whether he had demonised immigrants with a controversial campaign advert describing Latin American migrants as invaders, Trump called the reporter “rude” and ordered an aide to physically remove the mic from the journalist.
More than a dozen US media outlets, including Fox and the Associated Press, wrote friend-of-the-court briefs in support of CNN and Acosta’s lawsuit against the president.
“Fox News supports CNN in its legal effort to regain its White House reporter’s press credential,” the network’s president, Jay Wallace, said in a statement earlier this week.
Thirteen outlets issued a joint statement saying, “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.”
The outlets added, “It is imperative that independent journalists have access to the president and his activities, and that journalists are not barred for arbitrary reasons.”