In a dramatic operation to contain the coronavirus outbreak, four California Air National Guard troopers armed with testing kits rappeled onto a San Francisco-bound cruise ship Thursday to test passengers stranded at sea for two days to see if they have the contagious disease.

The emergency mission using two choppers and a fixed wing C-130J aircraft out of Moffett Field allowed 45 passengers on the Grand Princess, some 70 miles off the San Francisco coast, to be tested for the virus.

The kits were flown back Thursday afternoon to a California Department of Public Health laboratory in Richmond, where officials expect to have results Friday.

Some 3,533 people have been holed up in their cabins on the Grand Princess since former passengers from an earlier voyage tested positive for coronavirus and several of the current passengers also fell ill. Officials said the testing was done on a mix of guests and crew.

The action came on a frantic day in the Bay Area as San Francisco officials announced their first cases, Lowell High School was shut down after a student’s parent was diagnosed with COVID-19, and Santa Clara County officials saw their cases jump by six to 20.

Friends and family of people stranded on the ship waited desperately for news.

Lisa Egan said her 90-year-old father is aboard the ship with friends and had packed essential medications to get him through Saturday, when the trip was scheduled to end, but she worried about what could happen if the ship couldn’t dock by then.

“I am unbelievably stressed out about this. It’s the lack of information and wondering where they are going to end up. ... Is this going to be another Diamond cruise situation?” Egan said, referring to the Diamond Princess cruise ship that was held off the coast of Japan for weeks.

In that case, more than 700 of the 4,000 people aboard the Diamond Princess fell ill with the coronavirus and six died.

On the Grand Princess, whose home port is San Francisco, tests will determine whether any of the 2,422 passengers and more than 1,111 crew members have the coronavirus. Some are showing symptoms, authorities said.

They may have contracted the virus from three former passengers who were aboard the ship in February for a trip to Mexico and came down with the disease. The infected passengers were a 71-year-old Placer County man who died Wednesday, and two people from Sonoma County.

Authorities with the Centers for Disease Control and Prevention, the California Department of Public Health and the U.S. Coast Guard are developing a plan for meeting the Grand Princess once test results come in, Gov. Gavin Newsom said Wednesday as he announced a state of emergency for California.

Two helicopters approaching the #GrandPrincess with #coronavirus test kits. Again, my parents are on board (as well as many other parents and siblings and children). Please pray for them. @PrincessCruises @GavinNewsom @KTVU #COVID19 pic.twitter.com/XwlqTdV1uJ — Keane Li (@keaneli) March 5, 2020

Mary Ellen Carroll, director of the city’s Department of Emergency Management, said the test results are expected early Friday.

Meanwhile, the search began for the people who were on the Mexico cruise after state and federal public health officials ordered counties to track down and quarantine them.

Dr. Bela Matyas, the Solano County health officer, who reported the first case in California on Feb. 26, said the incubation period for those people ends Friday, which means it is probably too late to prevent those particular passengers from infecting others.

“We’re expected to find all of those people and do what with them?” Matyas said. “Quarantine them for one day?”

The Sunnyvale Department of Public Safety sent seven officers home for self-isolation after they performed CPR on a 72-year-old man who stopped breathing. He died and family members told the officers he had been a passenger on the Grand Princess and may have been in contact with people diagnosed with the virus.

“We are asking our community to remain calm,” said Phan Ngo, chief of the Sunnyvale Department of Public Safety, pointing out that the officers had not performed mouth to mouth. “The precautions we have taken exceed the recommendations by the CDC.”

The plight of the cruise ship is one example of a local and nationwide effort to isolate the fast-spreading disease, which began in China and is now threatening to become a global pandemic, if it isn’t already.

The disease was confirmed in San Francisco on Thursday when two residents — a man in his 90s and a woman in her 40s — tested positive for the virus, the first positive diagnoses in the city. Several other coronavirus patients have been treated at San Francisco hospitals, but those patients were not city residents.

The man and woman, whose names are not being released, had pneumonia-like symptoms. The man, who is in serious condition, suffers from underlying health issues and is in serious condition. The woman is in fair condition, said Dr. Grant Colfax, director of the city’s health department.

Neither patient had a history of travel to places with confirmed coronavirus cases, nor did they knowingly come into contact with anyone diagnosed with the disease.

The city victims are among 75 coronavirus cases in California, including 42 in the Bay Area. Nationwide, 233 cases have been confirmed, including 12 deaths, one in California and 11 in Washington state. Health officials believe there are many unreported cases.

The Grand Princess, operated by Princess Cruises, left San Francisco for a 15-day trip to Hawaii about eight hours after it returned Feb. 21 from an 11-day cruise to Mexico. When former passengers — from the Mexico cruise — were diagnosed with coronavirus 10 days after they had left the cruise ship, officials decided to hold the Grand Princess at sea.

The news onboard is troubling. Officials said 62 passengers now on the ship were also passengers during the February trip to Mexico and could have been exposed to the virus and spread it to the new passengers.

At least 20 people onboard had flu-like symptoms, officials said.

Neil Kran, a 69-year-old Sausalito resident, said he had been relaxing aboard the Grand Princess with his wife until a piece of paper was slipped beneath their door Wednesday, informing them the ship would skip its last stop because of the Placer County man’s death.

“The mood of people we’ve talked to is just kind of somber,” Kran said. “We’re caught up, and there’s not much we can do about it.”

Kran and his wife have received frantic messages from friends and family who asked if they are on the cruise that has dominated news headlines. “You’re not on the Grand Princess, are you?” one friend asked.

“Indeed, we are,” they answered.

Santa Clara County held a news conference Thursday to announce six new coronavirus victims, two of whom were hospitalized. Of the 20 total cases in the county, officials said, four were travel-related and nine had been in contact with infected people. Seven, however, had no known cause.

Dr. Sara Cody, Santa Clara County’s public health officer, urged people over age 50 or with cardiovascular or other health problems to avoid sporting events, conferences, concerts, parades and other social activities. San Mateo County’s health officer on Thursday also issued a similar advisory.

As worry spread, Lowell High School, in San Francisco, was closed, businesses urged employees to work from home, especially if they were feeling sick, and some people were spotted on the streets wearing masks.

Meanwhile, the union representing San Francisco’s registered nurses said Thursday that city hospitals are understaffed and not prepared for the outbreak.

Princess Cruises announced that its March 7 Hawaii cruise has been cancelled. The company offered full refunds of fares, hotel packages and prepaid shore excursions.

Peter Fimrite, Anna Bauman and Alejandro Serrano are San Francisco Chronicle staff writers. Email: pfimrite@sfchronicle.com, anna.bauman@sfchronicle.com, alejandro.serrano@sfchronicle.com Twitter: @pfimrite @abauman2 @serrano_alej