WASHINGTON – Acting Navy Secretary Thomas Modly resigned after mishandling the firing of the captain of the COVID-19-stricken USS Theodore Roosevelt, Defense Secretary Mark Esper announced Tuesday.

Esper accepted Modly's resignation letter Tuesday morning and said it was voluntary on Modly's part.

"He resigned on his own accord, putting the Navy and sailors above self so that the USS Theodore Roosevelt, and the Navy as a whole, can move forward," Esper said in a statement.

Esper named Army Undersecretary Jim McPherson, a retired admiral, to succeed Modly as acting Navy secretary until a permanent secretary is confirmed by the Senate.

President Donald Trump, at Tuesday's White House coronovirus task force briefing, said he had "no role" in Modly's resignation.

"He didn't have to resign but he did it for his country," Trump said.

Modly survived his initial decision to fire Capt. Brett Crozier, the aircraft carrier's skipper whose leaked email to Navy officials showed him pleading for help as the coronavirus swept through the Roosevelt's 4,800-member crew. Gen. Mark Milley, the chairman of the Joint Chiefs of Staff, and Adm. Mike Gilday, the chief of naval operations, voiced support for Modly's move.

Modly's decision to fly to Guam to visit sailors and explain his decision in a profanity-laced speech proved to be his undoing. He apologized Monday for his speech.

Modly had disparaged the former captain of the USS Theodore Roosevelt, calling him "too naive or too stupid" to command the stricken aircraft carrier.

"Let me be clear, I do not think Capt. Brett Crozier is naive or stupid," Modly said, according to the statement released by the Navy. "I think, and always believed him to be the opposite."

His apology came hours after Trump vowed to look into the matter. Trump called Crozier's email a "mistake," but he said Crozier had "a very good career," and he was reluctant to "destroy" it.

Trump reiterated Tuesday that Crozier shouldn't have written the letter. "He didn't have to be Ernest Hemingway."

Modly's speech drew fire from lawmakers calling for his ouster, including House Speaker Nancy Pelosi.

Sen. Jack Reed, D-R.I., the ranking member of the Armed Services Committee, said he supported Esper's decision to accept Modly's resignation. Reed asked for an inspector general's investigation.

"It is my understanding that acting Secretary Modly removed Capt. Crozier against the advice of senior Navy uniformed leadership and without completion of a proper investigation," Reed said in a statement.

The previous Navy secretary, Richard Spencer, was fired for his handling of another controversial case. That one involved Trump’s intervention in the case of Navy Chief Petty Officer Edward Gallagher, a Navy SEAL accused of war crimes. He was acquitted of murder but convicted of posing with a corpse.

On Tuesday, the Navy reported 230 positive coronavirus cases among the crew of the Roosevelt after testing 79% of them. About 2,000 sailors have been moved to facilities on shore in Guam, where the ship is docked.

The Roosevelt is the only coronavirus-stricken ship deployed – Guam is not its home port. Four other affected ships have not left their home ports. The affected sailors from the other ships have been isolated.

However, testing for COVID-19 has been limited to larger ships, and the Navy does not know how many smaller vessels at sea might be affected, said Sen. Richard Blumenthal, D-Conn., and also a member of the Armed Services Committee. The Defense official agreed that testing is limited but said deployed ships have had limited or no contact with the outside world and are considered low risk.

COVID-19 in the military:Cuts to training, recruiting, travel bans creating stress