A longtime Fox News analyst sharply criticized the network on Tuesday, denouncing the outlet as a "propaganda machine" devoted to President Trump, and saying that it was "wittingly harming our system of government for profit," in a stunning internal email announcing his exit from the company.

Ralph Peters, a US Army lieutenant colonel who served as a military analyst for Fox News, said he felt "compelled to explain" his departure from the company to colleagues, before skewering the network he has called home for years. Peters had been telling friends that he planned on leaving the network in a "nuclear" fashion, one of those friends told CNN. (In an email Wednesday morning, Peters said he had not told friends he "intended to make a splash" on his way out.)

"Four decades ago, I took an oath as a newly commissioned officer. I swore to 'support and defend the Constitution,' and that oath did not expire when I took off my uniform," Peters wrote in the letter sent to a handful of colleagues. "Today, I feel that Fox News is assaulting our constitutional order and the rule of law, while fostering corrosive and unjustified paranoia among viewers. Over my decade with Fox, I long was proud of the association. Now I am ashamed."

Related: Hannity jabs Shep Smith in sign of rift between Fox News opinion and news

In the letter, which was first reported on by BuzzFeed and confirmed by CNN, Peters said that he believed Fox News "degenerated from providing a legitimate and much-needed outlet for conservative voices" to morphing into a "mere propaganda machine for a destructive and ethically ruinous administration."

Peters cited the Fox News opinion hosts' relentless attacks on the FBI, Justice Department, intelligence agencies, and other branches of government. He said he believed Fox News was knowingly causing harm to the country in exchange for profit.

Peters said his criticism did not apply to Fox Business, the sister channel of Fox News, and said he deeply respected "the hard-news reporters at Fox," calling them "some of the best men and women in the business."

Fox News responded to Peters' email in a statement Tuesday evening. "Ralph Peters is entitled to his opinion despite the fact that he's choosing to use it as a weapon in order to gain attention," the network said. "We are extremely proud of our top-rated primetime hosts and all of our opinion programing."

Related: The Trump-TV feedback loop

Peters told CNN in an email, "Fox can assail me all it wants, but I intend to do what I believe is ethically correct."

As of late, Fox News has faced mounting criticism from the company's own employees. In October, "Fox News Sunday" anchor Chris Wallace told the Associated Press he was bothered by how some of his colleagues on the opinion side of the network used their platforms to attack the media. And Shepard Smith, the chief news anchor at Fox News, was critical of the Fox News opinion bloc in a story published last week.

-- CNN's Brian Stelter contributed to this report.