Deputy Director of National Intelligence Sue Gordon leaving her role

The current director, Dan Coats, is leaving his post on Aug. 15.

"Thank you for the opportunity to serve the Nation as the Principal Deputy Director of National Intelligence for the past two years. It has been an honor," Gordon wrote in her resignation letter, obtained by ABC News.

"As you ask a new leadership team to take the helm, I will resign my position effective 15 August 2019, and will subsequently retire from federal service," she wrote. "I am confident in what the Intelligence Community has accomplished, and what it is poised to do going forward."

"Sue Gordon is a great professional with a long and distinguished career. I have gotten to know Sue over the past 2 years and have developed great respect for her," Trump wrote on Twitter.

"A new Acting Director of National Intelligence will be named shortly," he added.

About an hour later, Trump tweeted that Joseph Maguire, the current director of the national counterterrorism center, would be named acting director of national intelligence, effective Aug. 15.

Coats supported the naming of Maguire in a statement, "I have had the pleasure of working with NCTC Director Joseph Maguire as part of my leadership team at ODNI, and I am pleased that the President has announced that Joe will serve as Acting DNI. Joe has had a long, distinguished career serving the nation and will lead the men and women in the IC with distinction."

Sen. Mark Warner, D-Va., criticized the removal of Coats and Gordon in a statement Thursday night.

"President Trump has repeatedly demonstrated that he is seemingly incapable of hearing facts that contradict his own views," he said. "The mission of the intelligence community is to speak truth to power; Yet in pushing out two dedicated public servants in as many weeks, once again the President has shown that he has no problem prioritizing his political ego even if it comes at the expense of our national security."

This all comes after the president tweeted over a week ago his intention to name Rep. John Ratcliffe, R-Texas, as Coats' replacement, but Ratcliffe quickly withdrew from consideration after reports surfaced about misrepresentations he made about his role in an anti-terrorism case while serving as U.S. attorney in Texas.

In tweets on Friday, Trump said "our great Republican Congressman John Ratcliffe is being treated very unfairly by the LameStream Media. Rather than going through months of slander and libel, I explained to John how miserable it would be for him and his family to deal with these people...."

Ratcliffe, in a statement, said he did not wish for a national security and intelligence debate surrounding his confirmation, "however untrue, to become a purely political and partisan issue."

"The country we all love deserves that it be treated as an American issue. Accordingly, I have asked the President to nominate someone other than me for this position," Ratcliffe said in the statement.

ABC News' Lee Ferran and Matthew Mosk contributed to this report.