WASHINGTON - Acting Navy Secretary Thomas Modly resigned Tuesday, bringing to a climax an extraordinary drama that he advanced by delivering a profanity-laced upbraiding of the officer he fired as captain of the coronavirus-stricken USS Theodore Roosevelt.

In announcing the resignation, Defence Secretary Mark Esper said Modly quit on his own accord, “putting the Navy and the sailors above self,” so the Navy and the Roosevelt can move forward. The Roosevelt is sidelined in port at Guam as members of the crew are tested for the coronavirus and moved ashore.

“His care for the sailors was genuine,” Esper said.

Esper said he briefed President Donald Trump on his conversation with Modly, and with the president's approval he is appointing James McPherson as acting Navy secretary. McPherson, a Navy veteran, is currently serving as undersecretary of the Army. He was confirmed in that position by the Senate last month.

Esper called McPherson a “smart, capable and professional leader who will restore confidence and stability in the Navy during these challenging times.”

Esper said he also met with Navy leaders and emphasized three priorities, including putting the health, safety and welfare of the Roosevelt crew first, and working to get the ship back out to sea as soon as safely possible.

Modly had created a combustible controversy by firing the Roosevelt's skipper, Capt. Brett E. Crozier, last week, saying Crozier had shown “extremely poor judgment” in widely distributing by email a letter calling for urgent help with the COVID-19 outbreak aboard his ship.

Modly then flew to the ship, at port in Guam, and delivered a speech to the crew Sunday in which he lambasted Crozier, saying he was either “too naive or too stupid” to be in charge of an aircraft carrier.

According to a senior defence official, Esper spoke to Modly Monday evening, directing him to apologize for his remarks about Crozier and setting a phone meeting for Tuesday morning. The official said Esper did not request or demand Modly's resignation, but instead discussed the situation and the way forward. The officials spoke on the condition of anonymity to discuss private conversations.

Modly came to his own conclusion and offered his resignation. Modly's options were few. Officials said it would have been difficult for him to rebuild his relationship with sailors in the fleet, and equally hard to restore his reputation among senior military leaders and retired naval officers who believed his sharp remarks on the Roosevelt crossed a line.

Asked about the resignation, Trump said Tuesday that he didn't know him or speak to him but credited Modly for resigning “to end that problem.” It was, he said, an “unselfish thing to do.”

By the time Modly issued his public apology Monday night, the calls among Democrats in Congress for his resignation were mounting. On Tuesday morning, House Speaker Nancy Pelosi said Modly must go.

“Sadly, Acting Secretary Modly's actions and words demonstrate his failure to prioritize the force protection of our troops,” Pelosi, D-Calif., said in a written statement. “He showed a serious lack of the sound judgment and strong leadership needed during this time. Acting Secretary Modly must be removed from his position or resign.”

Sen. Jack Reed, the top Democrat on the Senate Armed Services Committee, said Modly had fired Crozier against the advice of Navy military leaders.

“The new leadership of the Navy must do better in leading and protecting sailors, Marines and their families in this unprecedented crisis,” Reed said.

As of Tuesday, the Navy said 79% of the Roosevelt crew had been tested for the coronavirus, and 230 of them were positive. About 2,000 of the 4,865 crew members had been taken off the ship.

The episode began when the Roosevelt reported its first COVID-19 case among the crew on March 22, two weeks after making a port visit in Vietnam. The outbreak has sidelined the warship indefinitely and created conflict at the highest levels of the Pentagon.

Esper had publicly expressed his support for Modly's decision to fire Crozier, but after Modly's speech aboard the ship, Esper grew unsettled. Just hours after Modly issued a statement Monday defending his words, Esper compelled Modly to reverse course and issue a public apology.

“I want to apologize for any confusion this choice of words may have caused,” he wrote, referring to his speech aboard the Roosevelt. “I also want to apologize directly to Captain Crozier, his family, and the entire crew of the Theodore Roosevelt for any pain my remarks may have caused.”

Trump told reporters at the White House on Monday that he might get involved, agreeing that Modly's criticism of Crozier was “a rough statement.” He said Crozier made a mistake when he sent a memo to several people laying out his concerns about the crew and the virus. In the memo, which was leaked to the media, Crozier said: “We are not at war. Sailors do not need to die.”

Trump said Crozier had a good career prior to this incident, adding, “I don't want to destroy somebody for having a bad day.”

Modly, in his apology, reframed his earlier remarks that Crozier was “too naive or too stupid” to command. Instead, he said he believes Crozier is “smart and passionate.”

“I believe, precisely because he 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 wrote.

Aboard the ship, Modly had urged the crew to stop complaining.

“It is the mission of the ship that matters,” he said. “You all know this, but in my view your Captain lost sight of this and he compromised critical information about your status intentionally to draw greater attention to your situation.”

Modly, a 1983 Naval Academy graduate, became the acting Navy secretary last November after Richard Spencer was ousted from the position. Trump last month nominated retired Rear Adm. Kenneth Braithwaite, the current ambassador to Norway, to be the next Navy secretary.