Chief Gallagher’s lawyer, Timothy Parlatore, said the president was right to stop the process of ousting the commando because the Navy’s move was clear retribution, coming just days after the president’s decision to restore his rank.

“With the timing, it’s difficult to see how this was anything but a direct, public rebuke to the president,” Mr. Parlatore said. “So I can’t see how the secretary of defense or anyone else is going to convince the president that is O.K.”

On Friday, Mr. Spencer made clear that he wanted to move forward with the matter, which could strip Chief Gallagher of his Trident pin. “I believe the process matters for good order and discipline,” he told Reuters in an interview at a security forum in Nova Scotia.

On Saturday, a Navy spokesman pointed to those remarks. “The secretary’s comments are in line with current White House guidance,” said Rear Adm. Charlie Brown, the chief spokesman for the Navy.

A White House spokesman did not respond to requests for comment.

The gold insignia Trident pin is one of the most revered in the military. It features an eagle on an anchor, clutching a flintlock pistol and a trident, and represents the grit of sailors who made it through some of the toughest training in the Navy, and are given some of the riskiest missions. It stands for fidelity and sacrifice. Even in death, the pin plays a role: SEALs pound their pins into the wood of fallen comrades’ caskets.

The Pentagon had already been quietly fuming this month after Mr. Trump cleared three members of the armed services, including Chief Gallagher, who were accused or had been convicted of war crimes, overruling military leaders who sought to punish them. All three were lionized by conservative commentators who portrayed them as war heroes unfairly prosecuted for actions taken in the heat of battle.

Mr. Trump, who was lobbied heavily by the families of the three service members, announced on Nov. 15 that he was reversing the demotion of Chief Gallagher. He also ordered the full pardon of Clint Lorance, a former Army lieutenant, from the military prison at Fort Leavenworth, where he was serving a 19-year sentence for the murder of two civilians; and of Maj. Mathew L. Golsteyn, an Army Special Forces officer who was facing murder charges for killing an unarmed Afghan he believed was a Taliban bomb maker.