The acting secretary of the US Navy has resigned amid uproar over his handling of a coronavirus outbreak on an aircraft carrier.
Thomas Modly fired the USS Theodore Roosevelt’s captain after he pleaded for help in a letter leaked to media.
Mr Modly apologised on Monday after it emerged he had called Captain Brett Crozier’s actions “naive” and “stupid”.
The secretary’s exit comes a day after US President Donald Trump signalled he might get involved in the dispute.
Defence secretary Mark Esper said Mr Modly had “resigned of his own accord”.
The Pentagon chief said the crew’s health and safety were a priority for the department.
Army Undersecretary James McPherson is expected to replace Mr Modly.
Capt Crozier was fired last week, and footage of his crew sending him off the warship with applause went viral.
Mr Modly flew 8,000 miles on Monday to the Pacific island of Guam, where the USS Theodore Roosevelt is docked, and berated the crew for having cheered the captain as he left the ship.
Mr Modly told the crew what their former captain did “was very, very wrong” and amounted to “a betrayal of trust with me, with his chain of command”, according to recordings leaked to US media.
“If he didn’t think that information was going to get out into the public… then he was a) too naive or too stupid to be the commanding officer of a ship like this,” Mr Modly said. “The alternative is he did it on purpose.”
Amid rebukes from members of Congress, Mr Modly issued an apology the same day, saying: “I do not think Captain Brett Crozier is naive nor stupid. I think and always believed him to be the opposite.”
Capt Crozier sent a letter to defence officials on 30 March begging for assistance with a coronavirus outbreak on his vessel, which has more than 4,000 crew.
“We are not at war. Sailors do not need to die,” he wrote, requesting the quarantine of nearly the entire crew.
On Tuesday, Mr Trump said he had no role in Mr Modly’s departure, which he described as a “really unselfish” decision.
At the same time, the president emphasised Capt Crozier “made a mistake” with the letter, saying: “He didn’t have to be Ernest Hemingway.”
When asked about the controversy on Monday, President Trump told reporters: “You have two good gentlemen and they’re arguing. I’m good at resolving arguments.”
The president said he “heard very good things” about Capt Crozier and did not want his career to be ruined “for having a bad day”, but added that “the letter should not have been sent to many people unclassified”.
The US Navy is investigating Capt Crozier’s actions.
Democratic lawmakers in Congress have called for an inquiry into the decision to fire the captain.
Former Vice-President and current Democratic presidential front-runner Joe Biden also spoke out.
He said Capt Crozier’s firing was “close to criminal” and he should have been commended for saying “what had to be said”.
Over 155 of the aircraft carrier’s crew have tested positive for Covid-19.
More than 1,000 sailors who have tested negative for the virus are ashore in Guam, quarantining in hotels.