President Trump grew furious with senior advisers this week over a decision to allow 14 Americans who tested positive for coronavirus to return to the United States from Japan after being assured that infected patients would remain in quarantine overseas, according to administration officials.

Trump and the administration’s coronavirus task force were told last Saturday that Americans who had spent weeks in quarantine aboard the Diamond Princess luxury liner where the virus had spread to hundreds of passengers would be brought home on two chartered planes — but that patients who had symptoms or the infection itself would stay in Japan.

Trump was briefed on the decision and agreed that healthy passengers should not be on the plane with sick ones, three senior administration officials said. But the State Department and a top U.S. health official ultimately decided to bring back the 14 Americans who tested positive for the virus on the planes and place them in isolation — without informing the president first.

Trump learned of the decision only after the fact and was angry that he wasn’t consulted first, complaining that the decision could damage his administration’s handling of the response, according to administration officials familiar with the situation, who spoke on the condition of anonymity to discuss private conversations. Some members of the task force were not told in advance that the infected people would be placed on the plane and learned that only after the plane was on its way back to the United States.

The change of plans came late Sunday as 328 Americans sat in buses on the tarmac at Tokyo’s Haneda Airport and test results came back showing 14 of the passengers were infected with the virus but were not yet showing symptoms. Operations staff on the ground had to make a decision as to whether to bring the infected Americans back on the same plane or leave them in Japan.

Arrangements had been made in case passengers developed symptoms on the plane ride home, so officials in Washington from the State Department and a top administration health official overruled the Centers for Disease Control and Prevention based on information from operators on the ground in Tokyo. They decided to bring the infected passengers back home on the same planes but place them in an isolation area.

One of the officials arguing they should all be flown home together was Robert Kadlec, assistant secretary for preparedness and response for the Department of Health and Human Services and a member of the task force.

The State Department said the 14 passengers were already in the evacuation pipeline and that protocol dictated they be brought home. But the CDC had argued that even though the passengers were not showing symptoms, they still could spread the virus and should not be flown back with uninfected passengers. The CDC ultimately insisted it be left off the State Department’s news release on the evacuation.

After Trump learned of the change, he complained to his acting chief of staff, Mick Mulvaney, Domestic Policy Council director Joseph Grogan and HHS Secretary Alex Azar, who is running the president’s coronavirus task force, and other officials. Others who briefed the president and heard his ire include State Department official Stephen Biegun and Ken Cuccinelli, acting U.S. Citizenship and Immigration Services director.

Trump has since had several calls with top White House officials to say he should have been told, that it should have been his decision and that he did not agree with the decision that was made.

Azar led a call with the coronavirus task force Wednesday and told members that the president was upset over the decision, according to two White House officials. One senior White House official said not informing Trump of the decision ahead of time was a “big operational mistake.”

Mulvaney also was on the call and said the president had to know of such proposed moves in advance going forward.

HHS said it does not comment on internal deliberations.

Before the passengers were brought back, there were only 15 confirmed cases in the United States. At the time of the decision, the move to fly in the infected passengers would have nearly doubled the number of known coronavirus cases in the country. On Friday, the CDC said there were now 28 U.S. residents brought home from the Diamond Princess cruise ship who have tested positive for the virus.

The CDC also said Friday that it has changed the way it counts confirmed cases. One category will be for Americans who were repatriated by the State Department from the cruise ship and from previous State Department evacuations from Wuhan, China, the epicenter of the outbreak. These people were at higher risk for infection, and more are expected to test positive. The total number of repatriated patients with covid-19 infections is 31.

A second group of confirmed cases are 13 U.S. patients who either picked up the infection by traveling to China or from close contact with a family member.

Trump has remained uncharacteristically restrained in his public comments about the coronavirus outbreak, which has spread to more than two dozen countries and infected more than 75,000 people, the vast majority of whom are in China. During the 2014 Ebola outbreak, Trump, then a private citizen, called for the United States to shut its borders and said American doctors who had become infected with the disease while treating patients should not be allowed back into the country for treatment.

“The U.S. must immediately stop all flights from EBOLA infected countries or the plague will start and spread inside our ‘borders.’ Act fast!” Trump wrote.

Yet Trump also remains concerned that any large-scale outbreak in the United States could hurt his 2020 presidential reelection bid. He has also been unwilling to criticize China’s response to the outbreak despite some of his advisers pushing for a tougher stance, and has worried that any further drastic action by his administration could further spook the markets and hurt the economy in an election year.

Administration officials are concerned that they might not be able to quarantine large numbers of people in the United States if a pandemic breaks out. There have been at least 10 meetings on quarantines in the past two weeks, administration officials said.

Lena H. Sun contributed to this report.