The officials said Mr. Trump was furious with Mr. Esper for not supporting his inclination to use active-duty troops to quell protests in Washington, D.C., Minneapolis and elsewhere following the killing of George Floyd in Minneapolis on May 25.
The president consulted several advisers to ask their opinion of the disagreement, intent that day on removing Mr. Esper, his fourth defense secretary since taking office in January 2017, according to the officials. After talks with the advisers, who cautioned against the move, Mr. Trump set aside the plans to immediately fire Mr. Esper.
At the same time, however, Mr. Esper, aware of Mr. Trump’s feelings, was making his own preparations to resign, partly in frustration over the differences regarding the role of the military, the officials said. He had begun to prepare a letter of resignation before he was persuaded not to do so by aides and other advisers, according to some of the officials.