SAN FRANCISCO — A cruise ship hit by the new coronavirus is headed to the port of Oakland, California, the captain told passengers, though they were destined to stay aboard the ship for at least another day.

Grand Princess Capt. John Smith, in a recording provided by passenger Laurie Miller of San Jose, told guests the ship will dock in Oakland. Princess Cruises says it’s expected to arrive on Monday. The ship is carrying more than 3,500 people from 54 countries.

“An agreement has been reached to bring our ship into the port of Oakland,” he told passengers Saturday night. “After docking, we will then begin a disembarkation process specified by federal authorities that will take several days.”

Smith said passengers who need medical treatment or hospitalization will go to health care facilities in California, while state residents who don’t require acute medical care “will go to a federally operated isolation facility within California for testing and isolation.”

U.S. guests from other states will be transported by the federal government to facilities in other states. Crew members will be quarantined and treated aboard the ship.

Smith said the information he was given did not include any details about what would happen to passengers from other countries.

“We are working to obtain more details overnight. … I’m sorry I can’t provide you more details right now,” he said.

The Grand Princess had been forbidden to dock in San Francisco amid evidence that the vessel was the breeding ground for a cluster of nearly 20 cases that resulted in at least one death after a previous voyage.

Meanwhile, the U.S. death toll from the virus climbed to 19, with all but three victims in Washington state. The number of infections swelled to more than 400, scattered across the U.S., as passengers aboard the ship holed up in their rooms.

Steven Smith and his wife, Michele, of Paradise, California, went on the cruise to celebrate their wedding anniversary. The Smiths said they were a bit worried but felt safe in their room, which they had left just once since Thursday to video chat with their children.

Crew members wearing masks and gloves delivered trays with their food in covered plates, delivered outside their door. They’ve occupied themselves by watching TV, reading and looking out the window.

“Thank God, we have a window!” Steven Smith said.

The ship was heading from Hawaii to San Francisco when it was held off the California coast Wednesday so people with symptoms could be tested for the virus. Cruise officials on Saturday disclosed more information about how they think the outbreak occurred.

Grant Tarling, chief medical officer for Carnival Corporation, said it’s believed a 71-year-old Northern California man who later died of the virus was probably sick when he boarded the ship for a Feb. 11 cruise to Mexico.

The passenger visited the medical center the day before disembarking with symptoms of respiratory illness, he said. Others in several states and Canada who were on that voyage also have tested positive.

The passenger likely infected his dining room server, who also tested positive for the virus, Tarling said, as did two people traveling with the man. Two passengers now on the ship who have the virus were not on the previous cruise, he said.

Some passengers who had been on the Mexico trip stayed aboard for the current voyage — increasing crew members’ exposure to the virus.

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.

Hundreds of Americans aboard that ship were flown to military bases in California and other states for two-week quarantines. Some later were hospitalized with symptoms.

An epidemiologist who studies the spread of virus particles said the recirculated air from a cruise ship’s ventilation system, plus the close quarters and communal settings, make passengers and crew vulnerable to infectious diseases.

“They’re not designed as quarantine facilities, to put it mildly,” said Don Milton of the University of Maryland.

Worldwide, the virus has infected more than 100,000 people and killed more than 3,400, the vast majority of them in China. Most cases have been mild, and more than half of those infected have recovered.

Associated Press writers Olga R. Rodriguez and Juliet Williams in San Francisco; Gene Johnson, Martha Bellisle and Carla K. Johnson in Seattle; Adriana Gomez Licon in Miami; Rachel La Corte in Olympia, Washington; and AP researcher Monika Mathur in Washington, D.C., contributed to this report.