Sue Gordon is leaving the role of No. 2 spy chief in the U.S., ending a guessing game about whether President Trump would choose her to succeed outgoing Director of National Intelligence Dan Coats in an acting capacity.

With Coats resigning next Thursday, Gordon was slated to become acting director until a nominee was confirmed, per a federal statute. Trump even told reporters Friday he liked Gordon and did not rule out allowing her to become acting spy chief. "I like Sue Gordon. Sue Gordon is there now, and I like her very much. I’ve always liked her," he said.

But that changed Thursday after Gordon informed the president of her decision to resign.

"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. 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 Thursday evening.

....coincides with the retirement of Dan Coats. A new Acting Director of National Intelligence will be named shortly. — Donald J. Trump (@realDonaldTrump) August 8, 2019

In her resignation letter, revealed by a White House press pool report, Gordon thanked Trump, "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."

She added, "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. I am confident in what the Intelligence Community has accomplished, and what it is poised to do going forward. I have seen it in action first-hand for more than 30 years. Know that our people are our strength, and they will never fail you or the Nation. You are in good hands."

About an hour after announcing Gordon's resignation, Trump announced retired Navy Vice Adm. Joseph Maguire, the director of the National Counterterrorism Center, was his pick to be acting director of national intelligence.

....career in the military, retiring from the U.S. Navy in 2010. He commanded at every level, including the Naval Special Warfare Command. He has also served as a National Security Fellow at Harvard University. I have no doubt he will do a great job! — Donald J. Trump (@realDonaldTrump) August 8, 2019

There had been signs that Trump would circumvent Gordon from temporarily overseeing the U.S. intelligence community.

The White House requested a list of top officials who have worked in intelligence in what some saw as another sign Trump was looking at options beyond Gordon to take over temporarily. Trump also did not allow Gordon, who has served for more than 30 years in intelligence posts, to deliver a recent intelligence briefing at the White House, according to a recent New York Times report. A spokeswoman for the agency pushed back on that account, saying Gordon was not prevented from attending any recent briefing but did not elaborate on what happened.

Bloomberg reported Trump's allies outside the White House had urged him to remove Gordon, claiming she was too close to former CIA Director John Brennan, who is a vocal critic of Trump.

A top Republican on Capitol Hill called Gordon's retirement a "significant loss" to the U.S. intelligence community. "In more than three decades of public service, Sue earned the respect and admiration of her colleagues with her patriotism and vision. She has been a stalwart partner to the Senate Intelligence Committee, and I will miss her candor and deep knowledge of the issues. I look forward to seeing what new challenges she will tackle next," Richard Burr, chairman of the Senate Intelligence Committee, said in a statement.

Democrats were upset by reporting that said Trump might bypass Gordon for the acting role.

Rep. Adam Schiff, the chairman of the House Intelligence Committee, said, "The plain language of the law requires that [Gordon] be elevated to that role once Dan Coats steps down." The California Democrat argued that if the Trump administration bypasses her, it will be "further evidence of Trump's intent to politicize the Intelligence Community to serve his partisan aims."

Trump chose Rep. John Ratcliffe to be his nominee to replace Coats, but he announced last week he was dropping Ratcliffe as his pick amid scrutiny over the Texas Republican's credentials.