The defense chief demanded his resignation Sunday after Mr. Spencer attempted to cut a deal with the White House over the case of Navy SEAL Edward Gallagher, Mr. Spencer said.

Mr. Spencer had attempted to make a deal with the White House in which President Trump would allow the Navy to conduct an internal Navy review of Chief Gallagher, but that he would then be allowed to retire with his Trident pin, the revered symbol of his membership in the elite commando force. But Mr. Esper only learned of these efforts after the fact, and thus lost confidence in Mr. Spencer.

“I am deeply troubled by this conduct shown by a senior DOD official.” Mr. Esper said in a statement. “Unfortunately, as a result I have determined that Secretary Spencer no longer has my confidence to continue in his position. I wish Richard well.”