Acting Navy Secretary Thomas Modly resigned on Tuesday after he faced mounting backlash for firing and ridiculing the commander of a U.S. aircraft carrier who pleaded for help stemming a Coronavirus outbreak onboard.

The episode deepened upheaval in Navy leadership. The Navy’s last secretary was fired in November over his handling of the case of a Navy SEAL convicted of battlefield misconduct. The Navy SEAL had won the support of President Donald Trump.

U.S. Defense Secretary Mark Esper announced Mr. Modly’s resignation on Twitter, saying the Navy’s top civilian had ”resigned of his own accord.” Trump concurred, saying it was a selfless act and adding he had nothing to do with it.

“The whole thing was very unfortunate. The captain should not have written a letter. He didnt have to be Ernest Hemingway. He made a mistake, but he had a bad day,” Trump said at the White House.

Mr. Modly’s resignation occurred only after mounting pressure from Congress and a backlash from the crew, and followed Mr. Trump’s own suggestion on Monday that he might get involved in the crisis — saying the Navy captain whom Mr. Modly fired was also a good man.

“I briefed President Trump after my conversation with Secretary Modly,” Esper said, as he named an Army Undersecretary Jim McPherson to replace Modly as acting Navy secretary.

Captain Brett Crozier, whom Mr. Modly relieved of command last week, favored more dramatic steps to safeguard his sailors aboard the Theodore Roosevelt in a four-page letter that leaked to the public last week.

When Mr. Modly fired him over the leak, his crew hailed Crozier as a hero and gave him a rousing sendoff captured on video, apparently upsetting Modly and leading the Navy’s top civilian to fly to Guam to castigate the captain in a speech to the crew on Monday.

Apology after harsh comments

Modly questioned Mr. Crozier’s character, saying at one point he was either “stupid” or “naive.” After audio of his speech leaked, including expletives, Mr. Modly initially stood by his remarks. But later, at Esper’s request, he issued an apology.

But the apology was not enough to satisfy critics, who were calling for his resignation.

U.S. House of Representatives Speaker Nancy Pelosi added her voice to calls for Mr. Modly’s removal.

“Sadly, Acting Secretary Modly’s actions and words demonstrate his failure to prioritize the force protection of our troops,” Pelosi said in a statement.