SAN FRANCISCO (AP) — Federal and state officials in California were preparing Monday to receive thousands of people from a cruise ship that has been idling off the coast of San Francisco with at least 21 people aboard infected with the coronavirus.

Fences were being installed at an 11-acre site at the Port of Oakland, as authorities readied flights and buses to whisk the more than 2,000 passengers aboard the Grand Princess to military bases or their home countries for a 14-day quarantine. More than 3,500 on the ship hail from 54 countries.

“We’re making every effort to get them off the ship as safely and quickly as possible,” said Dr. John Redd of the U.S. Department of Health and Human Services, who urged passengers to remain in their rooms.

As the U.S. death toll from the virus reached at least 21 and the number of cases worldwide soared above 110,000, California Gov. Gavin Newsom and the mayor of Oakland sought to reassure the public that none of the Grand Princess passengers would be exposed to the U.S. public before completing the quarantine. The number of infections in the United States climbed above 500 as testing for the virus increased.

The Port of Oakland was chosen for docking because of its proximity to an airport and a military base, Newsom said. U.S. passengers will be transported to military bases in California, Texas and Georgia, where they’ll be tested for the COVID-19 virus and quarantined.

About 1,100 crew on the ship, 19 of whom have tested positive for the new virus, will be quarantined and treated aboard the ship, which will dock elsewhere, Newsom said.

“That ship will turn around — and they are currently assessing appropriate places to bring that quarantined ship — but it will not be here in the San Francisco Bay,” he said.

Dr. Anthony Fauci, the National Institutes of Health’s infectious diseases chief, said Sunday that widespread closure of a city or region, as Italy has done, is “possible.” U.S. Surgeon General Jerome Adams said communities will need to start thinking about canceling large gatherings, closing schools and letting more employees work from home, as many companies have done in the Seattle, Washington, area amid an outbreak at a care home that has killed 17.

Oregon Gov. Kate Brown declared a state of emergency Sunday because of the virus.

On the Grand Princess, passengers Steven and Michele Smith of Paradise, California, said they hope their time spent on the ship in quarantine will count toward the 14 days they are expected to isolate themselves. But they said officials have not yet provided an answer.

“We would love to get credit for the three or four days we’ve spent in our cabin,” Steven Smith said.

The Department of State was working with the home countries of several hundred passengers to arrange their repatriation, including nearly 240 from Canada.

The ship was held off the coast amid evidence it was the breeding ground for a cluster of at least 20 cases from a previous voyage.

Meanwhile, another cruise ship, the Regal Princess, pulled into a Florida port late Sunday night, after being held off the state’s coast for hours while awaiting coronavirus test results for two crew members, who did not have symptoms consistent with COVID-19.

Another Princess ship, the Diamond Princess, was quarantined for two weeks in Yokohama, Japan, last month because of the virus. Ultimately, about 700 of the 3,700 people aboard became infected in what experts pronounced a public-health failure, with the vessel essentially becoming a floating germ factory.

On Sunday, the U.S. State Department urged U.S. citizens against travel on cruise ships as officials said there was “increased risk of infection of COVID-19 in a cruise ship environment.”

Private companies and some public venues in the U.S. have been taking safety measures in an effort to limit the virus’ spread. Several universities have begun online-only courses, including the University of Washington, Stanford University and Columbia University. The largest school district in Northern California, with 64,000 students, canceled classes for a week when it was discovered a family in the district was exposed to COVID-19.

Weber reported from Los Angeles. Associated Press writers Juliet Williams in San Francisco and Robert Gillies in Toronto contributed to this report.