OAKLAND, Calif. — Thousands of passengers aboard a cruise ship struck by the coronavirus waited anxiously Tuesday for their turn to leave the vessel moored in the San Francisco Bay Area, even if it meant being shipped to military bases for weeks of quarantine.

After days of being forced to idle off the Northern California coast, the Grand Princess docked Monday at the Port of Oakland with about 3,500 passengers and crew on board — including 21 who had tested positive for the new virus.

READ MORE: Tentacles of Olympic cancellation would reach around globe

“We’re trying to stay calm and were trying to stay positive but it’s getting harder and harder. They can’t make up their minds how to keep us safe,” said passenger Beryl Ward, 77, of Santa Fe, New Mexico.

About two dozen people who needed acute medical care were taken off the ship, although it was not clear how many had tested positive for the new virus, said Brian Ferguson, a spokesman for the California Office of Emergency Services.

Many of the nearly 240 Canadians on board left the ship after the critically ill departed and stood outside two tents displaying Canadian flags. Canada and Britain were among the countries sending chartered flights to retrieve their citizens.

But about 2,000 passengers, including hundreds of Californians, were still aboard Monday night. The departure of passengers was scheduled to resume Tuesday morning, the captain told passengers.

The Grand Princess ship had been held off the coast since Wednesday because of evidence that it was the breeding ground for more than 20 infections tied to a previous voyage.

Passengers were isolated in their cabins for days. When they were finally allowed a few minutes on deck, Ward said, they were warned to wear masks and try to stay 6 feet (2 meters) away from each other.

WATCH: With the coronavirus, ‘pay attention to the basics’

Ward’s cabin mate, Carolyn Wright, 63, also of Santa Fe, said she looked out her cabin window as passengers lined up to depart and also saw people in yellow protective clothing, gloves and hazardous materials suits.

Video images showed long lines of people forming near processing tents and ambulances waiting to take some passengers away.

“They were queuing up the passengers like cattle,” Wright said. “Everybody was bunched up. They were physically touching each other and they were backed up along the gangplank.”

Some were taken away in chartered buses, Wright said.

Some arrived Monday night at Travis Air Force Base in Northern California. The ship carried people from 54 countries, and foreigners were to be flown home.

“I’m just totally freaked out by that,” said Wright. “It’s outrageous. If that’s safe, then why were we stuck in our rooms? It’s been stressed for the past five days that we’re not to have any contact with any other passengers?”

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

He called the elaborate but quickly planned disembarkation process a “really unprecedented and difficult operation.”

U.S. passengers were to be flown or bused from the port — chosen for its proximity to an airport and a military base — to bases in California, Texas and Georgia for testing and 14-day quarantines.

But Wright and others said nobody had been told the details. Only about 50 people had been tested for the virus.

“I’m willing to be quarantined,” Wright said. “’But I want to know if I’m positive or not. We don’t even know if we’re going to get tested. It’s all rumor and speculation.”

“I’m bored and frustrated,” she added. “All of a sudden a two-week vacation has turned into a five-week vacation.”

About 1,100 crew members, 19 of whom have tested positive for COVID-19, the disease caused by the virus, will be quarantined and treated aboard the ship, which will dock elsewhere after passengers are unloaded, California Gov. Gavin Newsom has said.

WATCH: Italy’s coronavirus outbreak sparks ‘a lot of panic’

The California governor and Oakland mayor sought to reassure people that none of the cruise ship passengers would be exposed to the public before completing quarantine.

Cruise ships have come under scrutiny by those who view them as potential germ factories because they pack thousands of people in close quarters.

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.

A third vessel, the Caribbean Princess, was supposed to dock in Grand Cayman on Monday but the cruise line said it will keep its thousands of passengers and crews from disembarking until crew members are tested for the COVID-19 virus.

Around the world, nations have limited the movements of millions of people in an effort to stop the spread of the virus.

In Northern California, Santa Clara County announced a ban of all large gatherings of at least 1,000 people through March. The announcement Monday came hours after the public health department announced the county’s first coronavirus death, a woman in her 60s.

The virus has shaken global markets, with stocks taking their worst one-day beating on Wall Street since 2008 and oil prices suffering their most brutal losses since the start of the 1991 Gulf War. Even with Asian markets posting modest gains Tuesday, fear was rampant that economies stood at the brink of recession.

For most people, the new coronavirus causes only mild or moderate symptoms, such as fever and cough. For some, especially older adults and people with existing health problems, it can cause more severe illness, including pneumonia.

According to the World Health Organization, people with mild illness recover in about two weeks, while those with more severe illness may take three to six weeks to recover. In mainland China, where the virus first exploded, more than 80,000 people have been diagnosed and more than 58,000 have so far recovered.

The virus has infected 600 people in the United States, and at least 26 have died, most in Washington state. 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 after an outbreak in the Seattle area.

READ MORE: Virus woes shift from China to Italy as borders slam shut

Pearl Jam on Monday announced it was postponing 17 North American shows on its upcoming tour over coronavirus concerns.

In Silicon Valley, NASA’s Ames Research Center is essentially closed with restricted access because an employee tested positive Sunday for the virus. Workers will be on “mandatory telework status” and three earth science airplane missions are being delayed to later this year, the county said.

Several universities have begun online-only courses, including the University of Washington, Stanford University, Columbia University and the University of California, Berkeley.

Rodriguez reported from San Francisco. Associated Press writers Janie Har, Jocelyn Gecker and Juliet Williams in San Francisco and Robert Jablon in Los Angeles contributed to this report.