Acting Navy Secretary Thomas Modly resigned Tuesday after fanning the flames of a controversy over a coronavirus outbreak on board an aircraft carrier.

In a tweet, Defense Secretary Mark Esper Mark EsperTop admiral: 'No condition' where US should conduct nuclear test 'at this time' Overnight Defense: Trump hosts Israel, UAE, Bahrain for historic signing l Air Force reveals it secretly built and flew new fighter jet l Coronavirus creates delay in Pentagon research for alternative to 'forever chemicals' Oldest living US World War II veteran turns 111 MORE said he accepted Modly’s resignation and that undersecretary of the Army James McPherson will take over as acting Navy secretary.

“This morning I accepted Secretary Modly's resignation. He resigned of his own accord, putting the Navy and the sailors above self so that the USS Theodore Roosevelt, and the Navy as an institution, can move forward,” Esper said in a statement attached to the tweet.

ADVERTISEMENT

This morning I accepted Secretary Modly's resignation. With the approval of the President, I am appointing current Army Undersecretary Jim McPherson as acting Secretary of the Navy. pic.twitter.com/FvfgOwuXw4 — @EsperDoD (@EsperDoD) April 7, 2020

The resignation comes a day after transcripts and audio of an inflammatory speech, in which Modly defended his decision to fire Capt. Brett Crozier as commander of the USS Theodore Roosevelt, leaked to the media.

Modly relieved Crozier of his command of the Roosevelt last week after a letter the captain wrote pleading for help with a coronavirus outbreak on the ship leaked in the media. Modly did not explicitly accuse Crozier of leaking the letter, but noted it appeared first in his hometown paper, the San Francisco Chronicle, and that he sent a copy to too many people to expect it not to leak.

In the speech aboard the Roosevelt, Modly said that if Crozier didn’t think the letter would leak, he was “too naive or too stupid to be a commanding officer of a ship like this.”

ADVERTISEMENT

Alternatively, Modly said, if Crozier leaked the letter on purpose, that would be a “serious violation” of the Uniform Code of Military Justice.

He also called Crozier’s action a “betrayal” and warned sailors that there is “no situation” in which they should go to the media, alleging “the media has an agenda” that “depends on which side of the political aisle they sit.”

Modly at first said Monday afternoon he stands by “every word,” but by Monday night was apologizing.

"Let me be clear: I do not think Captain Brett Crozier is naive or stupid,” Modly said in a statement. “I apologize for any confusion this choice of words may have caused.”

At a White House press briefing, President Trump Donald John TrumpHR McMaster says president's policy to withdraw troops from Afghanistan is 'unwise' Cast of 'Parks and Rec' reunite for virtual town hall to address Wisconsin voters Biden says Trump should step down over coronavirus response MORE said he would not have asked Modly to resign.

"I had heard he did because he didn’t want to cause any disturbance for our country. He wouldn’t have had to resign. I would not have asked him. I don’t know him. I didn’t speak to him. But he did that, I think, just to end that problem. And I think in many ways that was a very unselfish thing to do," Trump said.

Trump said he was unsure what would happen to Crozier, leaving it up to Esper and the naval chain of command. He called the letter a "mistake," harping on its eventual leak to the media.

“The whole thing was very unfortunate. The captain should not have written a letter. He didn’t have to be Ernest Hemingway," Trump said.

The day before, as uproar over Modly’s speech and Crozier’s firing was growing, Trump had said he “may just get involved" with the situation.

Modly initially had Esper’s support in firing Crozier, but the fallout from his speech became too much to overcome as a growing chorus of lawmakers called for his removal from office, including House Armed Services Committee Chairman Adam Smith David (Adam) Adam SmithWhen 'Buy American' and common sense collide Overnight Defense: Marine Corps brushes off criticism of Marines' appearance in GOP convention video | US troops injured in collision with Russian vehicle in Syria | Dems ask for probe of Vindman retaliation allegations Democrats press Pentagon watchdog to probe allegations of retaliation against Vindman brothers MORE (D-Wash.) and Speaker Nancy Pelosi Nancy PelosiMcConnell focuses on confirming judicial nominees with COVID-19 talks stalled Overnight Defense: Top admiral says 'no condition' where US should conduct nuclear test 'at this time' | Intelligence chief says Congress will get some in-person election security briefings Pelosi must go — the House is in dire need of new leadership MORE (D-Calif.).

“When I listened to the speech that acting Sec. 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,” Smith told reporters Tuesday in a response to a question from The Hill.

After the resignation, Smith said in statement that Modly “submitting his formal resignation to Secretary Esper was the right thing to do.”

ADVERTISEMENT

Sen. Jack Reed John (Jack) Francis ReedWhen 'Buy American' and common sense collide Hillicon Valley: Russia 'amplifying' concerns around mail-in voting to undermine election | Facebook and Twitter take steps to limit Trump remarks on voting | Facebook to block political ads ahead of election Top Democrats press Trump to sanction Russian individuals over 2020 election interference efforts MORE (R.I.), the top Democrat on the Senate Armed Services Committee, also said he agreed with Esper’s decision to accept Modly’s resignation because Modly “mishandled the situation.”

“These actions were inappropriate for the leader of the U.S. Navy at any time, particularly in a crisis, and did a disservice to Captain Crozier, the sailors of the USS Theodore Roosevelt, and all Navy personnel,” Reed said in a statement. “The new leadership of the Navy must do better in leading and protecting sailors, Marines and their families in this unprecedented crisis.”

Senate Armed Services Committee Chairman James Inhofe James (Jim) Mountain InhofeOvernight Defense: Top admiral says 'no condition' where US should conduct nuclear test 'at this time' | Intelligence chief says Congress will get some in-person election security briefings Top admiral: 'No condition' where US should conduct nuclear test 'at this time' When 'Buy American' and common sense collide MORE (R-Okla.) said he supports Esper’s personnel decisions “especially as we deal with this pandemic,” but that “it’s disturbing to me that there’s been so much turmoil at the top of the Department of the Navy over the last year.”

In his statement on Tuesday, Esper said Modly’s “care for the sailors was genuine” and that he “wish[es] him all the best.”

Esper said he briefed Trump after his conversation with Modly and that the president supported his appointment of McPherson to replace Modly.

Esper said he also met with McPherson, Chief of Naval Operation Adm. Michael Gilday, Deputy Defense Secretary David Norquist and Joint Chiefs of Staff Chairman Gen. Mark Milley. He gave Gilday and McPherson guidance “on the way ahead.”

ADVERTISEMENT

Esper also said he emphasized that his first priority in the coronavirus crisis is to “protect our people, which means putting the health, safety and welfare of the USS Theodore Roosevelt’s crew first.”

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

Crozier’s letter warned sailors could die if all but 10 percent of the 4,800-person crew wasn’t evacuated from the ship.

“We are not at war. Sailors do not need to die,” Crozier wrote. “If we do not act now, we are failing to properly take care of our most trusted asset — our sailors.”

After he was fired, his crew gave him a hero’s send-off, clapping and chanting his name as he walked off the ship.

As of Tuesday, the Navy reported 230 cases of coronavirus on the Roosevelt after 79 percent of the crew has been tested. The Navy said 1,999 sailors have been taken off the ship as it is docked in Guam, with 1,232 staying at hotels.

ADVERTISEMENT

Over the weekend, Modly told The Washington Post he stepped in to fire Crozier in part because he wanted to get out in front of any action by the president. Modly’s predecessor, Richard Spencer, was ousted amid a dispute with Trump.

Spencer was fired amid the fallout from Trump’s decision to restore the rank of Navy Chief Petty Officer Eddie Gallagher, who was convicted in the military justice system of posing with the corpse of an ISIS fighter but acquitted of murder.

In addition to restoring Gallagher’s rank, Trump ordered the Navy to allow Gallagher to keep his status as a SEAL after news broke the Navy was reviewing his Trident pin.

Last month, Trump nominated U.S. Ambassador to Norway Kenneth Braithwaite to be Navy secretary after first saying he would immediately after Spencer’s departure in November.

But it’s unclear when the Senate will be able to hold a confirmation hearing for Braithwaite and approve his nomination, as lawmakers remain largely out of Washington during the coronavirus pandemic.

“Once the Senate is back in session, I will make sure the Armed Services Committee considers the nomination of the next secretary of the Navy quickly, and I ask my fellow committee members to help me expedite this nomination as well,” Inhofe said in his statement. “Our Sailors, Marines and their families deserve to have stable, capable leadership at the helm during these challenging times.”

—Updated at 6:20 p.m.