A US District Court on Friday ordered the White House to temporarily restore the press credentials of CNN journalist Jim Acosta.

The journalist, who is CNN's chief White House correspondent, was barred from the White House after a contentious press conference with President Donald Trump. White House press secretary Sarah Huckabee Sanders accused Acosta of "placing his hands" on an intern as she sought to take the microphone from him after the president indicated he would not answer a question from Acosta.

Watch video 00:23 Acosta: 'Throughout all of this, I was confident'

Read more: Did Trump's White House publish a doctored video?

The White House agreed to temporarily reinstate Acosta's press pass after the order.

Judge Timothy Kelly, a Trump appointee, ordered the administration to restore Acosta's press pass while the case is pending. Kelly said there should be a due process in place for limiting a journalist's access to the White House.

<div class="opinary-widget-embed" data-poll="who-decides-who-questions-the-president_" data-customer="deutschewelleeng"></div> <script async type="text/javascript" src="//widgets.opinary.com/embed.js"></script>

Describing the White House's reasons for revoking Acosta's credentials, Kelly said the "belated efforts were hardly sufficient to satisfy due process."

Sanders had spelled out the reasons in a series of tweets only after CNN filed its lawsuit.

'Let's go back to work'

The judge also found that Acosta suffered "irreparable harm," as he dismissed the Trump administration's argument that CNN could just send other reporters to report on the White House in Acosta's place.

"Let's go back to work," Acosta told 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."

Trump has made no secret of his dislike for the US broadcaster, often describing the network as "fake news."

But in court, US government lawyers said Acosta was penalized for acting rudely at the conference and not for his criticisms of the president.

ap/sms (AP, Reuters, AFP, dpa)

Each evening at 1830 UTC, DW's editors send out a selection of the day's hard news and quality feature journalism. You can sign up to receive it directly here.