[Update: President Trump on Thursday reversed a Navy decision to oust Edward Gallagher from SEALs.]

The commander of the Navy SEALs, Rear Adm. Collin Green, had the three-page letter drafted and on his desk Tuesday, but he waited for hours to sign it.

For more than a year, he had considered expelling Chief Petty Officer Edward Gallagher from the SEALs, the Navy’s elite commando force, three Navy officials said, and his signature on the letter would start a process that could make that happen. But through the afternoon and late into the night, he held off, the officials said, watching for signs of pushback from one of the chief’s most vocal supporters, President Trump.

Admiral Green had made it a top priority to restore what he called “good order and discipline” to the SEAL teams, which have been bearing an outsize share of the war-fighting burden in Afghanistan, Iraq and elsewhere, and have been rocked by a series of scandals in recent years over charges of drug use, sexual assault and murder.

But as the admiral tried to reinforce ethics and accountability in the force, he saw Chief Gallagher as an obstacle, the Navy officials said, speaking on condition of anonymity because they were not authorized to discuss the matter publicly. The chief was disparaging other SEALs and insulting Navy leaders on social media, while making allies of conservative lawmakers and Mr. Trump, raising the prospect that any move against the chief could be a career-killer.