President Donald Trump got into a heated exchange with the CNN reporter Jim Acosta on Wednesday, prompting CNN to release an impassioned rebuke of the president.

CNN said Trump "does not respect a free press" but "has a sworn obligation to protect it."

"CNN should be ashamed of itself having you working for them," Trump told Acosta on Wednesday, later referring to him as the "enemy of the American people."

President Donald Trump got into a heated exchange with the CNN reporter Jim Acosta on Wednesday, prompting CNN to release an impassioned rebuke of the president.

"This President's ongoing attacks on the press have gone too far," the network said in a statement. "They are not only dangerous, they are disturbingly un-American."

CNN said Trump "does not respect a free press" but "has a sworn obligation to protect it."

"A free press is vital to democracy, and we stand behind Jim Acosta and his fellow journalists everywhere," CNN added.

As Acosta attempted to ask Trump questions at Wednesday's press conference, the president refused to answer and told him to sit down. At one point, a White House aide attempted to remove the microphone from Acosta's hands.

Read more: 'That's such a racist question': Trump lashes out at a black reporter who asked whether his rhetoric emboldens white nationalists

"Honestly, I think you should let me run the country and you run CNN," Trump said during the exchange.

The president told Acosta to "put down the mic" as the reporter asked questions on immigration and the investigation into Russia's election interference.

"CNN should be ashamed of itself having you working for them," Trump told Acosta, later referring to him as the "enemy of the American people."

Last month, CNN's New York office received a pipe bomb in the mail. Authorities have identified the person who sent it as Cesar Sayoc Jr., an outspoken Trump supporter whose van is said to have a "CNN Sucks" sticker on it.

Sayoc was charged with mailing bombs to CNN and several high-profile Democrats, including former President Barack Obama, former Secretary of State Hillary Clinton, and former Vice President Joe Biden.