Top military officials are standing up to President Donald Trump. The secretary of the Navy and the admiral who leads the SEALs both threatened to resign or be fired if Trump put a stop to the ongoing process to expel a commando from the elite unit due to war crimes, the New York Times reports. Trump has been a vocal supporter of Chief Petty Officer Edward Gallagher and recently intervened to order the Navy to restore his rank and pay, opening the door for him to retire on a full pension.

On Thursday, the president got involved once again and said in a tweet that he would intervene to make sure Gallagher can keep his special Trident Pin. “The Navy will NOT be taking away Warfighter and Navy Seal Eddie Gallagher’s Trident Pin,” Trump tweeted Thursday, referring to the pin that signifies membership in the elite force. “This case was handled very badly from the beginning. Get back to business!”

The threats by the Navy secretary, Richard Spencer, and the SEALs commander, Rear Adm. Collin Green mark a rare show of defiance against the commander in chief and have led officials in the Department of Defense to scramble to try to come up with a compromise. Defense Secretary Mark T. Esper and Gen. Mark Milley, the chairman of the Joint Chiefs of Staff, both told Trump of the huge consequence if he turned his tweet into a reality, including losing several key people while angering much of the top leadership in the military. Gallagher had been accused of shooting civilians and murdering a teenage prisoner in Iraq, among other crimes. He was ultimately acquitted of most of the more serious war crimes and convicted of illegally posing for pictures with the corpse of an ISIS fighter. He was demoted but Trump reversed that demotion.

Although administration officials hope Trump will allow the proceedings to move along, it is far from clear he won’t end up intervening. But Spencer, the Navy secretary, made clear he thinks the disciplinary case against Gallagher needed to move forward. “I believe the process matters for good order and discipline,” Spencer told Reuters.