CNN on Tuesday sued the Trump administration, demanding that it restore the press credentials of White House correspondent Jim Acosta.

Last week, Acosta got into a fiery exchange with US President Donald Trump during a press conference.

Acosta questioned Trump about his characterization of a migrant caravan making its way to the US border from Mexico as “an invasion.”

Acosta continued to press Trump, despite Trump’s demand that he "put down the mic," before a White House official finally took the microphone away from him.

Trump then scolded Acosta, calling him a “rude, terrible person" and adding, “CNN should be ashamed of itself having you work for them. You are a rude, terrible person. You shouldn’t be working for CNN.”

Hours later, the White House announced that it had suspended Acosta's credentials due to the fact that Acosta become physical with a young female intern as he tried to ask Trump a question during the news conference.

“President Trump believes in a free press and expects and welcomes tough questions of him and his Administration. We will, however, never tolerate a reporter placing his hands on a young woman just trying to do her job as a White House intern,” tweeted White House press secretary Sarah Sanders.

“This is a lie,” tweeted Acosta in response.

In Tuesday’s filing in Washington, D.C., District Court, CNN accuses Trump and other administration officials of violating Acosta's First and Fifth Amendment rights of free speech and due process, respectively, and asks a federal court in Washington to grant the "immediate restoration of Acosta’s press credentials."

"While the suit is specific to CNN and Acosta, this could have happened to anyone," the cable network said in a statement quoted by The Hill. "If left unchallenged, the actions of the White House would create a dangerous chilling effect for any journalist who covers our elected officials."

White House press secretary Sarah Huckabee Sanders dismissed the legal action as "just more grandstanding from CNN", adding the administration "will vigorously defend against this lawsuit."

"CNN, who has nearly 50 additional hard pass holders, and Mr. Acosta is no more or less special than any other media outlet or reporter with respect to the First Amendment," she said.

Trump has been a vocal critic of much of the mainstream media, and particularly of CNN.

Shortly after Trump was elected president, he and Acosta got into a shouting match similar to that which occurred on Wednesday, when Acosta insisted on asking Trump a question after Trump dismissed a CNN report on Russian hackers having sensitive information about him.

Acosta kept insisting on asking his question, and Trump told him, “Don’t be rude”, before concluding with, “You are fake news.”