Updated: 4:55 p.m.

Acting U.S. Navy Secretary Thomas Modly resigned on Tuesday, just over 24 hours after leaked audio showed him giving a profanity-laced speech slamming a warship captain he had recently fired.

“He resigned on his own accord, putting the Navy and the Sailors above himself, so the USS Theodore Roosevelt, and the Navy as an institution, can move forward,” Defense Secretary Mark Esper said in a late-afternoon statement announcing that he had accepted Modly’s resignation on Tuesday morning. “His care for the sailors was genuine.”

The news capped off a whirlwind evolution of recrimination, defiance, apology, and ultimately, resignation from the acting official since the speech became public in Washington on Monday morning.

Modly will be replaced by James McPherson, a retired rear admiral who is the current acting undersecretary of the Army. Trump has nominated Kenneth Braithwaite, the current U.S. ambassador to Norway, to the post permanently, but the Senate has yet to take up the nomination.

An investigation launched by Modly into the circumstances surrounding the dismissal of Capt. Brett Crozier will continue, Esper said. Any further possible action against Crozier will wait until that investigation is completed, he said.

“We must now put the needs of the Navy, and the crew of the Teddy Roosevelt first, and we must all move forward together,” he said.

On Monday morning, Guam time, Modly boarded the COVID-stricken aircraft carrier Theodore Roosevelt, turned on the public-address system, and told the crew that their former commanding officer — the one he had fired just days earlier — was either a) “naive or stupid” or b) had deliberately acted to publicize sensitive information. Either way, Modly said, Crozier’s decision to send Navy people outside his chain of command an urgent plea for help in evacuating his ship was a “betrayal” of all aboard.

Captured on an audio recording of the speech were sailors’ reactions, including “What the fuck?” and “He was trying to save us!”

The speech tilted some leaders’ perceptions of Modly’s already controversial relief-for-cause of Capt. Brett Crozier. As criticism and calls for his removal rolled in from Capitol Hill, Modly issued a midday statement: “I stand by every word I said.”

Those leaders included President Trump, who went from castigating Crozier on Saturday (“I thought it was terrible, what he did”) to talking about saving his career on Monday.

Modly himself ultimately flip-flopped, issuing an apology for the words he doubled-down on hours earlier: “Let me be clear, I do not think Captain Brett Crozier is naïve nor stupid. I think, and always believed him to be the opposite,” he wrote. “I believe, precisely because he is not naive and stupid, that he sent his alarming email with the intention of getting it into the public domain in an effort to draw public attention to the situation on his ship. I apologize for any confusion this choice of words may have caused.”

On Tuesday, around midday, Speaker of the House Nancy Pelosi added her voice to those calling for Modly’s removal.

A bit later, House Armed Services Committee Chairman Adam Smith, D-Wash., told reporters: “I'm sympathetic to Secretary Esper and Secretary Modly that they, the commander in chief is the commander in chief, but I am very, very worried about the impact that is having on their decision making. When I listened to the speech the Acting Secretary Modly gave, it was almost like he was trying to do sort of a half-assed imitation of how Donald Trump would have given a speech. It wasn't what I would have expected from Thomas Modly that I know.”

Modly is the second high-profile exit from the Navy’s top post in less than six months. Senate-confirmed Navy Secretary Richard Spencer was fired in late November 2019 amid the controversy over President Trump’s involvement in the case of Navy SEAL Edward Gallagher.

Marcus Weisgerber and Bradley Peniston contributed to this report.