WASHINGTON — Defense Secretary Mark Esper on Sunday fired the Navy’s top official over his handling of a disciplinary case involving a Navy SEAL.

Esper asked for the resignation of Navy Secretary Richard Spencer and Spencer submitted it Sunday, said the chief spokesman for the Pentagon, Jonathan Hoffman.

The firing was a dramatic turn in a long-running controversy involving Navy Chief Petty Officer Edward Gallagher, whose case has been championed by President Donald Trump.

Esper also directed that Gallagher be allowed to retire at the end of this month, and that a Navy disciplinary board that was scheduled to hear his case starting Dec. 2 be cancelled, Hoffman said. At Esper’s direction, Gallagher will be allowed to retire as a SEAL at his current rank, Hoffman said.

Hoffman said Esper lost trust and confidence in Spencer “regarding his lack of candor” over conversations with the White House involving the handling of the SEAL case.

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