(Bloomberg) -- Acting Navy Secretary Thomas Modly resigned Tuesday after an uproar over his decision to remove -- and then ridicule -- the commander of a U.S. aircraft carrier who demanded that the Pentagon do more to stop a coronavirus outbreak spreading through his ship, according to a person familiar with the decision.

Modly relieved Captain Brett Crozier of his command for writing and distributing a memo pleading in urgent terms for all but a skeleton crew to be removed from the USS Roosevelt, which was sidelined in Guam. “We are not at war,” Crozier wrote. “Sailors do not need to die.”

Modly said the captain’s memo, which was made public by the San Francisco Chronicle, his hometown newspaper, “jeopardized the national security interests of the United States” and that the Navy was already addressing Crozier’s concerns.

While the Navy leader had the backing of his superiors initially, that support was undercut when an audio recording surfaced of Modly telling the carrier’s crew that Crozier was “too naive or too stupid” to lead the ship. Modly’s resignation was reported earlier Tuesday by the Wall Street Journal.

The carrier is setting pierside in Guam struggling with a growing number of infections.

President Donald Trump had stopped short of taking sides between Modly and the carrier’s captain, who won a forceful ovation from his crew when he departed his ship. Trump said Crozier’s letter should never have been leaked, but he declined to take a sides in the dispute when asked at a news conference Monday evening.

“You have two good people and they are arguing,” the president said.

Democrats in Congress, including Speaker Nancy Pelosi and House Armed Services Chairman Adam Smith of Washington, called for Modly to resign.

“Sadly, Acting Secretary Modly’s actions and words demonstrate his failure to prioritize the force protection of our troops,” Pelosi said in a statement Tuesday. “He showed a serious lack of the sound judgment and strong leadership needed during this time.”

Evacuating Crew

The Roosevelt has now evacuated at least 2,000 of some 4,800 sailors to the shore on Guam as it tests the crew for Covid-19 infection. The Navy hopes to decontaminate the ship while keeping a small crew onboard to run its nuclear reactors, mind its ammunition and look after other critical functions.

Modly said he had lost confidence in Crozier, who has tested positive for the virus, because the captain had carelessly shared the memo widely, causing unnecessary alarm among crew and military families, and should have known it would become public.

In a public apology hours later, Modly walked back his statement calling Crozier naive or stupid. “I believe, precisely because he is not naive and stupid, that he sent this alarming email with the intention of getting it into the public domain in an effort to draw public attention to the situation on this ship,” he said in the statement.

Modly has served as acting secretary since November. His predecessor as Navy secretary, Richard Spencer, was fired amid a Pentagon dust-up over Trump’s insistence that a Navy SEAL acquitted of murder should be allowed to keep a Trident decoration signifying his service.

(Adds Trump’s earlier comment in seventh paragraph)

©2020 Bloomberg L.P.