President Trump’s continued denigration of Pentagon officials highlights the fraught nature of his relationship with Defense Secretary Mark T. Esper weeks ahead of the election, as the president’s remarks undermine his Pentagon chief and threaten to erode confidence in one of the nation’s most trusted institutions.

Trump has considered firing Esper since at least June, according to three officials, when the defense chief disagreed with the president’s plan to use active-duty troops to quell protests in the wake of the police killings of George Floyd and other Black civilians. Since then, Esper has made several decisions seemingly at odds with Trump.

“I think the president vacillates on whether he thinks Mark should go or not,” said a senior Republican Party official, speaking on the condition of anonymity to discuss the sensitive matter candidly. “Sometimes, you know, Esper gets under his skin.”

The tension between the two men centers on Esper’s sometimes futile efforts to protect the military in a hyperpartisan era — moves that have clashed with Trump’s political agenda. Esper is aligned with Trump on reducing the military presence in the Middle East and Afghanistan and has helped execute Trump’s more-divisive decisions, such as moving U.S. troops out of Germany and defunding Russian deterrence projects in Europe to pay for the border wall. But Esper has dug in when it comes to issues he believes threaten the apolitical tradition of the U.S. military.

“The issue presented by the difficulties that Secretary Esper has encountered is the difficulty between personalism and institutionalism — with President Trump and his family demanding loyalty to the president per se, as opposed to the institution,” said Eric Edelman, a top Pentagon official under President George W. Bush. “That’s the struggle here.”

The latest presidential snipe occurred last week when Trump was asked about reports that he had disparaged some U.S. troops.

“I’m not saying the military is in love with me; the soldiers are,” Trump claimed, denying the reports. “The top people in the Pentagon probably aren’t because they want to do nothing but fight wars so that all of these wonderful companies that make the bombs and make the planes and make everything else stay happy.”

White House Chief of Staff Mark Meadows later said that Trump was talking about the “military industrial complex” rather than current Defense Department leaders, though Esper is a former defense industry lobbyist. Some critics say the president’s comments could chip away at confidence in the military’s leadership, similar to the fallout from his feuds with intelligence agencies.

“By belittling your secretary of defense, by the other things [Trump] has done, he’s not just asserting the policy that he wants in these agencies, he’s reducing their effectiveness because he’s reducing their credibility,” said Rep. Adam Smith (D-Wash.), chairman of the House Armed Services Committee.

'Outstanding in every way'

Esper, 56, a retired Army officer and Gulf War veteran, became defense secretary in July 2019 during a tumultuous period in which the Pentagon lacked a permanent successor to Jim Mattis, who had resigned as defense secretary the previous December. Esper, then Army secretary, immediately faced questions about whether he could resist the president’s attempts to politicize the military for political gain.

Trump initially called his new defense secretary “outstanding in every way.” But he has taken to disparaging Esper openly this summer as the defense secretary makes statements that appear to contradict the president’s views, including a memo that effectively banned the Confederate flag at military bases. Esper also has said intelligence that Russian military officers offered money to Taliban fighters to kill American troops needs more research, while Trump has called the reports a hoax.

And unlike many other senior officials in the administration, Esper has not launched political attacks on behalf of the president, instead adhering to the conventional belief in the Defense Department that it should remain nonpartisan. Other administration officials have done so after angering the president.

Trump is expected to keep Esper through the election out of concern that removing him sooner could damage his reelection chances, according to the Republican Party official and two senior U.S. officials, who also spoke on the condition of anonymity to discuss the sensitive issue. But the president and Esper are expected to part ways shortly afterward, especially if Trump wins reelection, the officials said.

White House officials declined to speak publicly about personnel issues.

Esper is willing to stay as long as he can effectively shield the institution from politics and make progress on key initiatives, administration officials said.

Esper’s spokesman, Jonathan Rath Hoffman, said in a statement that Esper remains committed to implementing the Pentagon’s new strategy focused on countering China and Russia, which calls for modernizing the military.

“Under his leadership, the Department has also steered through the COVID-19 crisis while maintaining readiness and the well-being of our service members and families,” Hoffman said. “The Secretary is focused on the mission at hand and doing what is best for the Department of Defense, our men and women in uniform, and the country.”

The situation has put Esper in the awkward position that previous top Trump administration officials faced, including former attorney general Jeff Sessions, former secretary of state Rex Tillerson and former national security adviser John Bolton. Trump left all of them in their positions for months while deriding them publicly as rumors circulated that they would be fired.

When asked last month if he had confidence in Esper’s leadership, Trump replied with an insult.

“Mark Yesper? Did you call him Yesper? Some people call him Yesper,” Trump said, referring to the defense secretary by a derogatory nickname that some officers adopted for Esper to suggest he wasn’t doing enough to manage the president.

Trump said he gets along with Esper “fine” — and then added that he has considered firing “everybody.”

White House officials have talked to Veterans Affairs Secretary Robert Wilkie about taking over the Pentagon if Trump and Esper part ways, according to three officials with knowledge of the idea, which was first reported by NBC News. Before serving as VA secretary, Wilkie was a Pentagon undersecretary.

A VA spokeswoman, Christina Mandreucci, referred a question about Wilkie’s potential candidacy for defense secretary to the White House. The White House declined to comment about Wilkie’s standing.

Smith credited Esper with managing the situation in a way that has allowed him to pursue needed reforms in the Pentagon.

“He’s trying to do that with one hand while fending off the insanity from the White House with the other,” Smith said.

As Trump has publicly dismissed the views of military leaders or abruptly reversed their decisions, Smith said he has heard from foreign leaders who second-guess American officials after such comments.

Early signs of tension

Esper, in his confirmation hearing in July 2019, said he would “absolutely” step down if he was asked to support a policy that ran counter to his values.

Within weeks, the Pentagon was thrust into a crisis concerning the war in Syria. Esper initially said it would be “unacceptable” for Turkey, a NATO ally, to launch an incursion into Syria to target Kurdish forces who had fought in the campaign against the Islamic State. But the Trump administration stepped aside in October when Turkey launched an operation.

In the ensuing chaos, the U.S. military bombed some of its own bases as it rapidly withdrew, and veterans of the conflict accused the United States of betraying its Kurdish partners. Trump and other officials argued that they did not have a good alternative, but the situation nonetheless stoked concern that Esper would not be able to temper the president’s impulses.

“He’s more playing the role of a military subordinate than a normal SecDef,” one former senior defense official said of Esper, citing the Syria example.

A current senior administration official disputed that assertion, saying Esper and Army Gen. Mark A. Milley, then the new chairman of the Joint Chiefs of Staff, recommended pulling back Special Force soldiers who were near the Syrian-Turkish border for their own protection.

In November, Esper and Army Secretary Ryan McCarthy failed to persuade Trump not to intervene in three high-profile war-crimes cases.

Less than two months later, Esper broke with Trump after the president threatened to bomb cultural sites in Iran amid rising tensions that prompted the United States to launch a fatal strike on the Iranian general Qasem Soleimani in Baghdad. The U.S. military, Esper said, would “follow the laws of armed conflict.”

Other issues soon emerged, including the White House’s removal of numerous Pentagon appointees deemed insufficiently loyal.

Esper’s stance on the promotion of Lt. Col. Alexander Vindman, who testified against Trump during his impeachment trial, also received scrutiny. Critics, including Sen. Tammy Duckworth (D-Ill.), said Esper wasn’t doing enough to protect him from harm. Esper approved a promotion list in July with Vindman on it but avoided a potential confrontation with the president when Vindman opted instead to retire, citing a pattern of “bullying” by the White House.

Trump also called for the removal of thousands of troops from Germany, framing the plan in June as a punishment of the U.S. ally for not spending more on its own military. Esper and other senior defense officials detailed their plan in July, casting the move instead as an effort to create unpredictability and counter Russia.

Esper understood the president’s position but wanted to implement it in a manner that made the country strategically and tactically stronger, a senior administration official said. The plan has been panned by a group of lawmakers that includes Sens. Mitt Romney (R-Utah) and Ben Sasse (R-Neb.), and may be blocked.

But the events in June, amid the national outcry about racial injustice and police brutality, still loom largest for Esper.

As protests erupted across the country, Esper said in a June 1 conference call with Trump, other administration officials and governors that the government needed to “dominate the battlespace” against protesters, prompting outrage among some civilians. Afterward, Esper expressed regret for using military terminology in conversations with civilian officials.

In a White House meeting the same day, Trump demanded that 10,000 troops be sent into America’s streets and screamed at Esper and other officials who advised against involving active-duty forces, according to officials familiar with the episode.

That afternoon, Trump held a news conference at the White House. As he was speaking, authorities forcibly cleared protesters outside from Lafayette Square so the president could pose for photos at nearby St. John’s Episcopal Church, which had been partially burned in a protest.

Esper and Milley appeared with the president in the park, prompting concerns that the defense officials were allowing Trump to politicize the military.

Two days later, Esper distanced himself from the president, saying in a news conference that he did not see the use of the Insurrection Act — which would be invoked to use active-duty troops — as necessary.

Trump almost immediately began thinking of replacing Esper, people with knowledge of his thinking said.

Lisa Rein and Josh Dawsey contributed to this report.