Acting Secretary of the Navy Thomas Modly resigned Tuesday after facing backlash for calling the ousted captain of a coronavirus-stricken aircraft carrier “stupid.”

Defense Secretary Mark Esper said he accepted Modly’s resignation Tuesday morning, stating that Modly has stepped down “on his own accord.”

“Secretary Modly served the nation for many years, both in and out of uniform,” Esper wrote in a statement. “I have the deepest respect for anyone who serves our country, and who places the greater good above all else. Secretary Modly did that today, and I wish him all the best.”

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 faced public criticism and calls for his resignation by some lawmakers after he lambasted Capt. Brett Crozier on Monday for writing a letter to Navy leaders that was leaked to the media. In his letter, Crozier pleaded for swift and more comprehensive action to address the coronavirus outbreak on his ship, the USS Theodore Roosevelt.

Modly fired Crozier as commander of the ship last week, citing a loss of confidence in the captain’s judgment. Crozier received a standing ovation from his crew as he departed on Friday.

In a blistering address to the Roosevelt’s crew Monday morning, Modly bashed Crozier as “stupid” and “naive,” and dubbed his actions “a betrayal.”

Despite criticism for his harsh remarks, Modly said in a statement later Monday that he stood by “every word” of his address. But hours later, he reversed course and issued an apology, reportedly at Esper’s request, to the Navy, Crozier and the Roosevelt’s crew.

“I believe, precisely because [Crozier] 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,” Modly said in his apology on Monday. “I apologize for any confusion this choice of words may have caused.”

Modly did not reinstate Crozier, however. Esper said in his statement Tuesday that any further action regarding Crozier will wait until the Navy completes its investigation into what happened on the Roosevelt.

At least 230 sailors on the Roosevelt have tested positive for the virus, according to the Navy. As of Tuesday, 79% of the Roosevelt’s crew had been tested and nearly 2,000 sailors had been transported ashore.

The New York Times, citing two Naval sources close to Crozier and his family, reported Sunday that Crozier has tested positive for COVID-19.

President Donald Trump addressed Modly’s resignation at his Tuesday afternoon press briefing, saying that he thought “the whole thing was very unfortunate” and that Modly “probably shouldn’t have said quite what he said” to the ship’s crew.

But Trump also went off on Crozier again, saying the captain “shouldn’t be writing letters and sending them to many people and then it gets out to the media.”

When asked about Modly’s criticism of Crozier on Monday, Trump had told reporters that he was “going to get involved” and “see exactly what’s going on there.”

“You have two good people and they’re arguing, and I’m good ― believe it or not ― at settling arguments,” Trump said Monday. “The letter shouldn’t have been sent. With all of that said, [Crozier’s] career prior to that was very good.”

“I don’t want to destroy someone for having a bad day,” he added.

Esper said in his statement Tuesday that he had briefed Trump on Modly’s resignation. With the president’s approval, Esper said he is appointing Army Under Secretary Jim McPherson as acting Navy secretary.

Modly, who had been under secretary of the Navy since December 2017, took on the role of acting secretary in November after Esper fired Navy Secretary Richard Spencer over his handling of the Eddie Gallagher case.

The Navy had kicked Gallagher out of the Navy SEALs after he was convicted of posing in a photo with the corpse of a teen ISIS fighter. But Trump intervened to reinstate Gallagher as a member of the elite force.

Lydia O’Connor contributed reporting.