One of America’s most seasoned intelligence officials is leaving the building. Sue Gordon, who spent more than 25 years in the CIA before becoming second-in-command at the Office of the Director of National Intelligence (ODNI), was confirmed to be departing on Thursday by President Trump.

Gordon was next in line to serve as acting director after current director Dan Coats announced his resignation effective Aug. 15. Bloomberg reported on Thursday that Gordon’s departure was confirmed following a meeting she had with Trump in the Oval Office, though New York Times reporter Maggie Haberman reported Gordon had actually met with Vice President Mike Pence and left a resignation letter.

Gordon is said to have left a handwritten note to Trump suggesting she was stepping down at his wishes.

“I offer this letter as an act of respect & patriotism, not preference. You should have your team,” she was quoted as writing by The Wall Street Journal. She also reportedly noted in her resignation letter to Trump that she was leaving “as you ask a new leadership team to take the helm.”

Trump confirmed the news of her departure in a tweet praising Gordon as “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. Sue has announced she will be leaving on August 15, which coincides with the retirement of Dan Coats. A new Acting Director of National Intelligence will be named shortly,” Trump tweeted.

That tweet was quickly followed by another one announcing Navy veteran Joseph Maguire, the current director of the National Counterterrorism Center, as the new Acting Director of National Intelligence starting Aug. 15. As The Daily Beast reported earlier this week, the NCTC, which is overseen by the ODNI, was established in the wake of 9/11 to track foreign terrorists but had recently begun to focus on the domestic terror threat as well.

Coats offered warm words for both Gordon and Maguire after Trump’s announcement late Thursday, calling Gordon a “visionary leader who has made an enormous impact” on the intelligence community and expressing confidence that Maguire “will lead the men and women in the IC with distinction.”

Gordon’s departure is the latest instance of tumult in the Intelligence Community, and it’s generating significant concern among national security officials.

“She’s been a staunch believer in the Intelligence Community’s responsibility to speak truth to power,” said a former senior intelligence official. “You wouldn’t want to lose that when she walks out the door.”

Gordon’s departure came as Trump worked to overhaul the upper echelons of the Intelligence Community. After announcing in a July 28 tweet that Coats would leave ODNI on Aug. 15, Trump said he would nominate Republican Rep. John Ratcliffe to take his place. But Ratcliffe faced a tough confirmation process and quickly withdrew his name from consideration following controversy over his political allegiance to the president and apparent inaccuracies on his resume.

Gordon initially looked like a likely candidate to fill the role, but shortly after Trump announced Coats’ impending departure, reports emerged that he wanted someone other than Gordon to take his place. And before news of her impending departure broke, the White House had asked ODNI for a list of senior intelligence officials who had been at the department for 90 days or more–apparently part of a search for people qualified to take Coats’ role.

Gordon spent decades in government, and she built a reputation as an effective, non-partisan workhorse with fans in both parties on Capitol Hill. At her Congressional hearing to be Coats’ deputy (a Senate-confirmed post to which Trump nominated her), her broad support actually generated levity. Mark Warner, the Vice Chairman of the Senate Intelligence Committee, cited a post on the Cipher Brief about her in his opening remarks:

“She’s ‘said to be widely liked by members of both political parties, deeply respected,’ ‘straight shooter,’ and a whole series of other wonderful compliments,” Warner said. “So if you screw up, this is going to come back and bite you.” Senators chuckled––the joke was, how could Gordon ever screw something up?

She also helped deepen the Intelligence Community’s relationships in the private sector, and helped start In-Q-Tel, a private non-profit that helps connected America’s national security agencies with start-ups.

Greg Brower, a former senior FBI official, said Gordon’s departure could make the U.S. less safe.

“Her departure is extremely unfortunate for the IC and would suggest a continuing effort on the part of the White House to fill extremely important positions that are supposed to be completely a-political and nonpartisan with people who are simply loyal to the president,” he said. “And that would obviously be a very bad thing for U.S. intelligence operations generally and, more broadly, for the national security of our country.”

-- Erin Banco contributed reporting