WASHINGTON — President Trump on Thursday abruptly decided to install Joseph Maguire, the director of the National Counterterrorism Center, as the acting director of national intelligence after Dan Coats steps down from the post next week.
Mr. Trump announced his decision to elevate Mr. Maguire, a retired vice admiral who once led the Navy’s Special Warfare Command, on Twitter shortly after confirming that Sue Gordon, the nation’s No. 2 intelligence official — who by law had been in line to temporarily take over as director — would instead depart with Mr. Coats on Aug. 15.
Ms. Gordon, who served more than 30 years in intelligence posts at the C.I.A. and other agencies, informed Mr. Trump of her decision to retire in a letter on Thursday after it became clear that he would not permit her to rise to the position of acting director.
“As you ask a new leadership team to take the helm, I will resign my position,” she wrote, adding: “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.”
The sudden shuffle in the highest ranks of the intelligence community added to the turmoil since Mr. Trump announced on Twitter on July 28 that Mr. Coats would leave and that Representative John Ratcliffe, a Texas Republican who is an outspoken supporter of the president, would be his nominee for the next director.
But last Friday, Mr. Trump dropped his plan to nominate Mr. Ratcliffe after it came to light that he had exaggerated his counterterrorism experience as a former federal prosecutor, and as concerns mounted among lawmakers of both parties that he lacked qualifications for the job.
In his initial Twitter announcement, Mr. Trump suggested that Ms. Gordon might not become the acting director until a new one was confirmed, notwithstanding the succession statute. The New York Times reported last Friday that the White House had decided not to let Ms. Gordon become the director, although she had not yet been formally informed of that choice, and that the administration had requested a list of other senior agency officials, a suggestion that it was searching for a different successor.
The signs of turmoil prompted lawmakers of both parties, including those leading the Senate Intelligence Committee, Senators Richard M. Burr, Republican of North Carolina, and Mark Warner, Democrat of Virginia, to issue strong expressions of support.
Mr. Burr called her departure “a significant loss” for the intelligence community.
“In more than three decades of public service, Sue earned the respect and admiration of her colleagues with her patriotism and vision,” he said in a statement on Thursday. “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.”
Representative Adam B. Schiff, a California Democrat who leads the House Intelligence Committee, portrayed the ousters as a “devastating loss” that threatened the intelligence community’s ability to provide independent analysis and judgment to policymakers.
“Gordon brought decades of experience and encyclopedic knowledge of the agencies to bear, and her absence will leave a great void,” he said. “These losses of leadership, coupled with a president determined to weed out anyone who may dare disagree, represent one of the most challenging moments for the intelligence community.”
In a sign of how Mr. Trump’s circle viewed Ms. Gordon, the president’s son Donald Trump Jr. expressed opposition to her on Twitter last week, referring to John O. Brennan, the former C.I.A. director during the Obama administration and a frequent Trump critic. The younger Mr. Trump spoke of “rumors about her being besties with Brennan and the rest of the clown cadre.”
A federal statute says that if the intelligence directorship becomes vacant, the deputy director — Ms. Gordon — shall serve as acting director. But the law appears to give the president much more flexibility in choosing whom to appoint as the acting deputy if the No. 2 position is vacant.
That legal structure creates a loophole for a president who wants to evade the apparently strict limitations on who can become acting director: If both positions are vacant at the same time, the president can temporarily install someone to his liking in the No. 2 position who then will rise to serve as the acting director by virtue of the vacancy at the top.
Under the law that created the Office of the Director of National Intelligence and the Federal Vacancies Reform Act, if the position of deputy director is vacant, Mr. Trump can temporarily install as the acting deputy director any sufficiently senior official in the intelligence community, or anyone else currently serving in a Senate-confirmed position in the broader executive branch.
Mr. Maguire, whom the Senate confirmed to lead the National Counterterrorism Center in December, would qualify by either method.
In a statement, Mr. Coats praised Ms. Gordon’s three decades of service, while also saying he was “pleased” that Mr. Maguire would serve as the acting director.
After The Times reported that the White House would not let Ms. Gordon become the acting director, Mr. Trump claimed to reporters that he was still considering her for the role. But she made clear to colleagues that she would resign rather than be fired if the president decided he wanted to install someone else in her role so that person could become the acting director. Less than a week later, she was out.
Earlier last week, in an apparent sign of hostility, Mr. Trump did not allow Ms. Gordon to personally deliver a recent intelligence briefing after she arrived at the White House, according to a person familiar with the matter.
A spokeswoman for the Office of the Director of the National Intelligence said at the time that Ms. Gordon had not been blocked from attending any recent briefing, but she declined to comment about what had happened inside the Oval Office.
In recent days, Mr. Burr has suggested that Mr. Trump consider nominating the retired admiral Michael S. Rogers, who ran the National Security Agency and the military’s cybercommand from 2014 to 2018, along with two other prospects, according to people familiar with the discussions.
Pete Hoekstra, the American ambassador to the Netherlands and a former Republican House member from Michigan who led the House Intelligence Committee, is said to be another candidate.