Sign up for our special edition newsletter to get a daily update on the coronavirus pandemic.

Acting Navy Secretary Thomas Modly has resigned after giving a profane speech defending his firing of a ship captain who warned about the coronavirus infecting his crew.

Modly resigned after meeting with Defense Secretary Mark Esper on Tuesday, according to multiple reports.

Acting undersecretary of the Army James McPherson will replace Modly.

On Sunday Modly trashed fired Capt. Brett Crozier to his former crew on the USS Theodore Roosevelt, saying Crozier was either “too naive or too stupid” for command after raising concern about the coronavirus spreading through his nuclear-powered aircraft carrier.

Last week Crozier emailed more than 20 people warning of symptoms among his men and urging action to treat them. The email was published by the San Francisco Chronicle, creating an international news story.

At least 230 people aboard the USS Theodore Roosevelt — including Crozier – tested positive for COVID-19 after it docked in Guam.

“The T-R has to demonstrate to the citizens back home that it has its act together and that it’s knocking down this virus just like it would knock down the Chinese or the North Koreans or the Russians,” Modly told the crew Sunday.

“What the f–k?” an apparent sailor says in leaked audio as Modly disparaged Crozier. “He was just trying to help us!” a man’s voice protests.

Modly on Friday claimed that Crozier put the 5,000-man crew “at risk” of attack when he sent the email.

President Trump said at a Monday news conference that he would like to mediate between Modly and Crozier, saying the captain may have simply had a “bad day” when he emailed his warning to people outside his chain of command.

The Defense Department did not immediately respond to a request for comment from The Post.