Washington CNN  — 

President Donald Trump announced on Twitter Monday that he has fired Secretary of Defense Mark Esper, and that Christopher Miller, who serves as director of the National Counterterrorism Center, will become acting secretary “effective immediately.”

The President jettisoned Esper two days after his Democratic opponent Joe Biden was projected as the winner of the presidential election, a conclusion that Trump has refused to accept.

Esper’s increasingly tense relationship with Trump led him to prepare a letter of resignation weeks ago, an attempt to fashion a graceful exit in the widely expected event that the President decided to fire him, several defense sources, including one senior defense official, told CNN.

Esper’s firing has raised concerns that other top national security officials who have earned Trump’s wrath may be next in the line of fire.

Trump and some of his conservative allies have become increasingly frustrated with CIA Director Gina Haspel in recent weeks, accusing her of delaying the release of documents they believe would expose so-called “deep state” plots against Trump’s campaign and transition during the Obama administration, according to multiple current and former officials.

Haspel has refused, arguing that declassifying the documents would endanger US national security by revealing crucial methods and sources.

In recent months, Trump and his allies have also sharply criticized FBI Director Christopher Wray over his failure to produce information that they claim would be harmful to the President’s political enemies, including Biden. The prospect that Trump may fire Wray has hung over the FBI for weeks, CNN has reported.

Shortly before Trump’s tweet landed early Monday afternoon, the President’s chief of staff Mark Meadows called Esper to tell him he was about to be fired and replaced, sources tell CNN.

Esper responded to Trump in a letter dated Monday, which said, “I serve the country in deference to the Constitution, so I accept your decision to replace me.”

“I step aside knowing there is much we achieved at the Defense Department over the last eighteen months to protect the nation and improve the readiness, capabilities, and professionalism of the joint force, while fundamentally transforming and preparing the military for the future,” Esper added in the letter, a copy of which has been obtained by CNN.

Republican reaction muted

Republican reaction was muted. The chairman of the Senate Armed Services Committee, Sen. James Inhofe of Oklahoma, thanked Esper for his service. Texas Rep. Mac Thornberry, the ranking member of the House Armed Services Committee, noted that Esper “has served the nation well under very challenging circumstances.”

Sen. Mark Warner, the Virginia Democrat and vice chairman of the Senate Select Committee on Intelligence, said he was “deeply troubled” by the firing. “The last thing that our country needs is additional upheaval in the institutions designed to protect our national security,” Warner continued in his statement and warned against further firings of “any Senate-confirmed intelligence or national security officials during his time left in office.”

Warner also said that “there is no doubt that our adversaries are already seeking vulnerabilities they can exploit in order to undermine American global leadership and national security during this transition period.”

In the wake of Esper’s firing, the chairman of the Joint Chiefs of Staff, Gen. Mark Milley, held a secure video teleconference in the “tank” with the joint chiefs and combatant commanders around the world, an official told CNN. Those officials will now call their counterparts overseas to assure them the US military mission continues and to assure them the Pentagon is maintaining its military stability around the world, the official said.

Miller, who will step into Esper’s shoes, has been a driving force behind some of Trump’s policies targeting Iran and its proxy group Hezbollah, as well as counterterrorism efforts linked to the wars in Syria and Iraq. Prior to heading the NCTC, Miller was director of counterterrorism at the National Security Council.

An Iowa native and retired US Army officer, Miller has also served as a deputy assistant secretary of defense. Miller was seen arriving at the Pentagon Monday afternoon and, soon after, met with Milley and other top staff for critical briefings on issues such as the nuclear codes and military operations around the world. Miller told officials to not expect “significant changes at this time,” the official said.

Esper had been on shaky ground with the White House for months and had been pushing back on Trump since 2019 – important context for today’s firing, senior administration officials told CNN.

Esper was among those administration officials in 2019 who urged the President to release aid to Ukraine that Trump blocked as he pressured the country’s president for investigations into Biden’s son, Hunter Biden, and Ukraine’s alleged support for Hillary Clinton in the 2016 election. And Esper cautioned Trump not to completely pull troops out of northern Syria in October 2019.

After National Guard troops and US Park Police violently dispersed peaceful protestors in June, so Trump could hold a photo op in Lafayette Square, Esper took extra caution to try to keep the US military out of the realm of the President’s political desires.

Esper’s rift with the President deepened after he said in a June press briefing that he did not support using active-duty troops to quell the large-scale protests across the United States triggered by the death of George Floyd at the hands of police.

Esper, who did not want US troops in the streets during the unrest over the summer, told the President not to invoke the Insurrection Act, and in recent months was subjected to White House ire over his insistence that the Pentagon and US military not be part of the President’s reelection campaign, in contrast to the actions of Attorney General William Barr, Director of National Intelligence John Ratcliffe, Secretary of State Mike Pompeo, and Agriculture Secretary Sonny Purdue.

Esper’s June remarks from the Pentagon briefing room were seen by many as an effort to distance himself from Trump and went over poorly at the White House, multiple people familiar with the matter said.

Esper disagreed with Trump on Afghanistan, senior administration official says

A senior administration official told CNN’s Jake Tapper that Esper disagreed with Trump on Afghanistan. While Esper does support getting the US out of Afghanistan as a goal, he does not believe conditions are appropriate for a withdrawal of all US service members as the President may be preparing to do, the official said.

Some close to Esper wonder if Trump fired him on Monday so he can soon pull troops out of that country without prompting public opposition and a resignation from his secretary of Defense.

Esper also ran afoul of the President when he said publicly that the military would never target Iranian cultural sites for bombing, after Trump had threatened to do so in January 2020.

And Esper had thought he had talked the President out of pardoning Chief Petty Officer Eddie Gallagher, a Navy SEAL convicted of war crimes, only to see Navy Secretary Richard Spencer go outside the chain of command to discuss the matter with the White House, according to the official. Trump went ahead and granted Gallagher a pardon.

According to multiple administration officials, over many months, those incidents slowly soured White House sentiment about Esper. Both Trump and national security adviser Robert O’Brien viewed him as not entirely committed to the President’s vision for the military and both were frustrated by Esper’s tendency to avoid offering a full-throated defense of the President or his policies, the administration officials said.

One administration source told CNN that Trump had no respect for Esper, leaving the defense secretary with little influence and little choice but to take his lead from Pompeo.

Trump dubbed him ‘Yesper’

Trump went as far as to mock his defense chief’s derisive nickname of “Yesper” during a news conference in August, a moniker bestowed upon Esper by defense officials who believed he did not go far enough in standing up to the President’s more controversial decisions.

Privately, Trump had expressed frustrations about Esper for months, venting about him at length during a trip to Camp David earlier this year, according to multiple sources.

Trump also publicly lambasted Pentagon leadership in September, accusing them of seeking to fight wars in order to boost the profits of defense contractors. Esper, angry, called White House chief of staff Meadows to complain, according to defense officials. Meadows soon afterward appeared on television and attempted to walk back Trump’s comments, saying his broadside against the Pentagon’s leaders had not been directed at anyone in particular.

Esper and Trump also differed over the highly charged issue of whether to rename military bases that honor Confederate generals. Esper supported consideration of the renaming. The President refused to accept the idea.

The Senate voted 90-8 in July 2019 to confirm Esper, making him Trump’s second Senate-confirmed secretary of defense. He followed James Mattis, who had resigned in December 2018 over Trump’s decision to retreat from Syria amid the fight with ISIS, abandoning Kurdish allies and pulling US troops out of the war-torn country.

This story has been updated with additional reporting Monday.

CORRECTION: This story has been corrected to identify James Inhofe as a senator.

CNN’s Jake Tapper, Evan Perez, Zachary Cohen, Betsy Klein, Kaitlan Collins and Vivian Salama contributed to this report.