WASHINGTON — Military leaders hoping to keep the Secretary of the Navy from quitting lobbied President Donald Trump aboard Air Force One to stop intervening in the case of a Navy SEAL accused of murder, say five current and one former military and defense officials.

On Thursday Trump waded once again into the case of Chief Petty Officer Edward Gallagher, a Navy SEAL accused of murdering a wounded ISIS militant in Iraq in 2017. Gallagher was acquitted by a military court but found guilty of posing with the dead prisoner's body.

Trump, who had previously restored Gallagher’s rank, denounced a new Navy administrative probe into whether Gallagher should remain in the elite SEAL corps. “The Navy will NOT be taking away Warfighter and Navy Seal Eddie Gallagher's Trident Pin. This case was handled very badly from the beginning. Get back to business!” the president tweeted.

The SEAL Trident pin or Special Warfare Insignia is a symbol of membership in the SEALs.

On Thursday, Navy Secretary Richard Spencer had responded to Trump, telling the White House that a tweet is not an official order and if the president is ordering the Navy to end the Trident Review Board of Gallagher, he needs to do so in writing, according to five current and two former military officials.

The officials say he also explained to the White House that the Navy needs direction on whether the president also wants to suspend the review board for three other SEALS also scheduled to undergo the assessment.

Four officials familiar with Spencer’s thinking say he is strongly considering resigning and will do so if Trump signs a written order to end the Navy probe. He conveyed those feelings to Pentagon leaders on Thursday.

Download the NBC News app for breaking news and politics

“He is deeply, deeply upset by this and believes it undercuts his authority,” one former Navy official said, adding that it also undercuts Rear Adm. Collin Green, commander of the Navy’s Special Warfare Command, who ordered the review and is trying to maintain good order and discipline in the SEAL community.

Spencer said Saturday at an international security forum in Canada that he never "threatened" to resign.

"Contrary to popular belief, I am still here," he tweeted. "I did not threaten to resign. We are here to talk about external threats and Eddie Gallagher is not one of them."

Spencer also released a statement Saturday that said, "In no way, shape or form did I ever threaten to resign. This has been incorrectly reported in the press. I serve at the pleasure of the president."

The flight to Dover

Several of the president’s senior advisers and military leaders weighed in after Trump's Thursday tweet about Gallagher, explaining the consequences of ordering a halt to the review board, say officials.

Chairman of the Joint Chiefs Gen. Mark Milley, Deputy Secretary of Defense David Norquist, Army Chief of Staff General McConville, Army Secretary Ryan McCarthy, and Sgt. Major of the Army Michael Grinston spoke with the president about the process on Air Force One Thursday night, according to three U.S. officials familiar with the conversation.

The military leaders were with the president en route to Dover Air Force Base in Delaware for the return of the bodies of two U.S. soldiers killed in Afghanistan earlier this week.

They explained that the Trident Review Board is a peer review process and it’s best to let the process play out, the three officials said. The president did not know details of the process, the officials said, including how fellow sailors, usually Navy master chiefs, are the ones who make the recommendation.

The president also asked about the cases of former 1st Lt. Clint Lorance and Maj. Matthew Golsteyn. Earlier this month Trump dismissed murder charges against Golsteyn and pardoned Lorance, who was serving 19 years in federal prison for murder.

Trump inquired about restoring Golsteyn’s status as an Army Ranger and special forces soldier. The leaders explained how Trump wading in could impact morale among troops, said the three officials. They stressed that the conversation was not contentious. The military leaders explained the process to Trump, who listened and asked pointed questions, including flatly asking the group what he should do.

According to the officials, the leaders told him it was his decision as commander in chief, but they wanted him to understand the consequences.

At the White House Friday, other Trump administration officials echoed Gen. Milley’s advice about Gallagher’s review board, said officials. Secretary of State Mike Pompeo and Secretary of Defense Mark Esper both explained that the president ordering a halt could have wider consequences.

Unless there is a written order, the Navy plans to move forward with the review process, the officials said. They do not expect Trump to issue that written order at this point, but concede he could change his mind.

The White House did not immediately respond to a request for comment.

A senior Defense Department official said the president is commander in chief and has the ultimate authority to make these decisions if he chooses.

On Friday, Spencer told reporters at an international security forum in Halifax, Nova Scotia, that he believes Gallagher’s review process should go forward. Cmdr. Sarah Higgins, Spencer’s spokesperson, said, “Secretary Spencer’s comments are in line with current White House guidance.”

A spokesperson for Gen. Milley declined to address specifics about conversations the chairman of the joint chiefs has had with the president or his fellow military leaders. “The chairman speaks to service secretaries and chiefs regularly about a myriad of topics,” said Col. DeDe Halfhill. "Those conversations are privileged and confidential."