Acting Navy Secretary Thomas Modly resigned on Tuesday after he called Captain Brett Crozier, who was fired last week, “stupid” in a speech to the USS Theodore Roosevelt’s crew on Monday.

Modly faced swift backlash for his remarks, including calls by lawmakers for his resignation, which led to his public apology on Monday night after asserting earlier that he meant “every word.”

“Let me be clear, I do not think Captain Brett Crozier is naive nor stupid,” he said in a statement. “I think, and always believed him to be the opposite. We pick our carrier commanding officers with great care.”

Modly submitted his resignation letter to Defense Secretary Mark Esper, who confirmed in a statement that he has accepted it. Modly is also resigning from his role as permanent undersecretary of the Navy.

“He resigned on his own accord, putting the Navy and the Sailors above self so that the U.S.S. Theodore Roosevelt, and the Navy as an institution, can move forward,” Esper wrote. “His care for the sailors was genuine.”

Esper said that he is appointing James McPherson, acting undersecretary of the Army, as a replacement for Modly, which President Trump has approved.

Capt. Crozier was fired last week after a letter was published in The San Francisco Chronicle in which he pleaded with the U.S. Navy for resources to isolate more than 100 sailors infected with the novel coronavirus on the USS Theodore Roosevelt aircraft carrier.

“This will require a political solution but it is the right thing to do,” Crozier, who later tested positive for the virus, wrote in the stunning letter. “We are not at war. Sailors do not need to die. If we do not act now, we are failing to properly take care of our most trusted asset—our Sailors.”

“Removing the majority of personnel from a deployed U.S. nuclear aircraft carrier and isolating them for two weeks may seem like an extraordinary measure. ... This is a necessary risk,” Crozier continued. “Keeping over 4,000 young men and women on board the TR is an unnecessary risk and breaks faith with those Sailors entrusted to our care.”

After the letter was published last Tuesday, Modly said that the U.S. Navy would evacuate the majority of the crew and the warship would be disinfected. At least 230 crew members have tested positive for the coronavirus as of Tuesday.

Modly flew 8,000 miles to the island of Guam to visit the ship on Monday, but sailors told The New York Times he didn’t take a tour of the vessel and instead addressed them over an intercom, blasting their fired commander. He told the crew of the virus-stricken ship that Crozier was either “too naive or too stupid” to be a leader and claimed that the commander intentionally leaked the letter to the media, which he condemned as a “betrayal.”

His handling of the alarming letter, the subsequent firing of the captain, and his profane rant, eventually prompted President Trump to consider intervening. “I may look into it,” said Trump, who said he supported Crozier’s removal, “from the standpoint that something should be resolved.”

House Speaker Nancy Pelosi on Tuesday called for the removal of Modly, saying that he “showed a serious lack of the sound judgment and strong leadership” in ousting Crozier and that his “actions and words demonstrate his failure to prioritize the force protection of our troops.”