WASHINGTON — The acting secretary of the Navy resigned Tuesday after his handling of the coronavirus outbreak on the aircraft carrier Theodore Roosevelt prompted sharp criticism.

Defense Secretary Mark Esper said in a statement that he had accepted acting Secretary Thomas Modly’s resignation Tuesday, the day after Modly apologized for having criticized former Roosevelt commanding officer Capt. Brett Crozier to the carrier’s crew.

Esper said Modly had offered to resign so the Navy could “move forward.”

Modly removed Crozier, a Santa Rosa native, from command of the Roosevelt after the captain wrote a letter to superiors pleading for more efforts to evacuate the carrier in Guam as a coronavirus outbreak spread. The letter was obtained and published by The Chronicle. Modly blamed that on Crozier’s decision to copy more than 20 people on his letter.

Modly then delivered a speech to the crew onboard the ship, disparaging Crozier as “stupid” or “naive,” comments for which he apologized late Monday.

There were 230 confirmed cases of coronavirus among the carrier’s crew as of Tuesday, the Navy said. Nearly 80% of the 5,000-person crew has been tested, with more than 2,000 testing negative. Crozier, 50, tested positive for the virus.

About 40% of the Roosevelt’s sailors have been moved ashore.

In his weekly memo to the Navy, Modly explained his decision to resign and apologized again for his actions.

“The crew deserved a lot more empathy and a lot less lecturing,” Modly wrote in the memo, which the Navy provided to The Chronicle. “My lack of situational awareness due to my emotions of the moment did the exact same thing to MY ship, as I would hold you accountable for as you lead yours. I brought incoming fire onto our team and I am convinced that the fire will continue unrelentingly until the target is gone. I know what I have to do save the ship.”

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

Modly’s actions handling the outbreak had spurred criticism from Democrats in Congress. They objected both to the Navy’s initial response to protect sailors and Modly’s firing of Crozier and speech on the ship.

House Speaker Nancy Pelosi, D-San Francisco, called for Modly’s resignation on Tuesday, as did several other members of the Bay Area delegation.

President Trump said Tuesday that he had “no role” in Modly’s resignation and didn’t even know him, “but I’ve heard he was a very good man.”

Asked about Crozier, Trump said, “He didn’t have to be Ernest Hemingway. He made a mistake, but he had a bad day.”

Esper said Army Undersecretary Jim McPherson will serve as acting secretary of the Navy.

“There are no winners here,” retired Adm. James Stavridis, former NATO supreme allied commander Europe, told The Chronicle. “Acting Secretary Modly did the right thing for the Navy, and his resignation will tamp down the emotion over the crisis on USS Roosevelt.”

Modly’s speech to the crew on Monday came after hundreds of sailors chanted Crozier’s name when he departed command. In a 15-minute speech, Modly disparaged that hero’s send-off and criticized Crozier’s actions, according to audio obtained by The Chronicle.

“If he didn’t think ... that this information wasn’t going to get out into the public, in this information age that we live in, then he was too naive or too stupid to be commanding officer of a ship like this,” Modly said. “The alternative is that he did it on purpose.”

Modly is a Naval Academy graduate and a former helicopter pilot, who left service to pursue a business career. Before becoming undersecretary of management in 2017, he worked for the accounting firm PwC.

He took the acting position in November, after the previous Navy secretary was forced out over a dispute with Trump about intervening in the war-crimes case of a Navy SEAL.

“After his speech to the Roosevelt, which was so tone deaf, he was doomed,” said Mark Cancian, a senior adviser with the Center for Strategic and International Studies think tank in Washington, D.C.

Modly “could have salvaged his position,” Cancian said, if “he stuck to his basic argument” — that Crozier hadn’t fully informed Navy officials of the situation aboard the Roosevelt and had allowed his letter to get into too many hands.

Mark Blakewood, whose son serves on the Roosevelt, had called for Modly’s removal and was pleased at the news.

“Mr. Modly can now join the rest of us while ‘we stay at home’ and witness how the Navy responds to providing proper aid and support to the brave men of the USS Teddy Roosevelt and others in the Navy,” Blakewood told The Chronicle.

Chronicle staff writer Matthias Gafni contributed to this report.

Tal Kopan is The San Francisco Chronicle’s Washington correspondent and Joe Garofoli is The San Francisco Chronicle’s senior political writer. Email: tal.kopan@sfchronicle.com, jgarofoli@sfchronicle.com Twitter: @talkopan, @joegarofoli