CNN  — 

The Grand Princess cruise ship floated for days off the coast of San Francisco in early March like an omen to a coming disaster.

“We could see it from our windows,” said Dr. Robert Wachter, professor and chair of the Department of Medicine at University of California, San Francisco. “That made it real.”

It was one early warning sign that would prompt California to take extraordinary steps to slow the spread of coronavirus, especially after the White House announced that 21 people aboard the cruise ship had tested positive for Covid-19.

Within weeks of the Grand Princess cruise ship arriving off the California coast – an early harbinger of the coming coronavirus pandemic – Gov. Gavin Newsom issued the first statewide mandatory restrictions in the United States.

California and New York – the nation’s hardest-hit state – had about the same number of coronavirus cases in the first week of March, according to Covid Tracking Project.

By Wednesday morning, California had more than 17,000 cases compared to nearly eight times that in New York, or more than 140,000 cases. The Golden State has 452 deaths to New York’s more than 5,000.

“When we write this history and look at the tens of thousands of lives in California that will have been spared, I think there will be lots of factors that went into it,” said Dr. Robert Wachter, professor and chair of the department of medicine at the University of California, San Francisco.

“The most important was that leaders of all types – whether they were in government or in businesses – took it seriously, believed that this was a real risk and did the right thing early.”

Here is what California did right in response to the contagion:

Silicon Valley employees started working from home

People line Baker Beach near the Golden Gate Bridge on Sunday, March 22, 2020, in San Francisco. Some 40 million Californians are coping with their first weekend under a statewide order requiring them to stay at home to help curb the spread of the coronavirus.
California braces for wave of coronavirus cases
02:33 - Source: CNN

In early March, health officials in Northern California recommended that companies allow employees to work from home, suspend nonessential travel and stagger starting and closing times.

Apple encouraged its Silicon Valley employees to work from home, according to a company spokesperson. Its Seattle employees also began working remotely.

The iPhone maker’s headquarters is in Cupertino. It also has offices in Santa Clara.

“So much of the businesses, particularly in Northern California, are the tech businesses, and companies like Google and Apple and Salesforce and others told their employees to work from home as early as March 5,” said Wachter.

“There was a general sense here that this is serious stuff, that the experts are telling us we need to do this – and people listened.”

San Francisco Bay area issues shelter-in-place order

In a measure considered draconian at the time, nearly seven million Northern Californians were ordered to shelter in place March 16.

Along with San Francisco and Berkeley, residents in San Mateo, Santa Clara, Marin, Alameda and Contra Costa counties were required to stay home, per orders from local health officers.

Essential businesses stayed open, as did mass transit – but only for travel to and from essential services.

“That was no accident,” Dr. George Rutherford, professor of epidemiology at the University of California San Francisco, said of the timing. “It was the day before St. Patrick’s Day, which is a huge mixing event as you can imagine.”

San Francisco also lent assistance to those hurt by the restrictions, including grants for small businesses.

Lead Mayor London Breed Live_00034804.jpg
SF Mayor: More than 7 million people in Northern California urged to shelter in place
04:41 - Source: CNN

“Why people are praising San Francisco is because everyone here knew how important it was to follow instructions and … that is what is going to get us through, make us successful, keep us safe,” San Francisco Mayor London Breed said Friday.

Weeks after San Francisco issued the country’s first shelter-in-place order for residents, hospital emergency rooms throughout the region appear to be seeing the early effects.

“The surge we have been anticipating has not yet come,” Dr. Jahan Fahimi, an emergency physician and medical director at the University of California San Francisco, said this week. “We’re all kind of together holding our breaths.”

As of Friday, the city reported 497 confirmed infections and seven deaths from the coronavirus. And while the availability of testing is still much lower than officials would like, the modest daily count compared to other major urban centers is a sign that early action in the country’s second most densely populated city had an impact.

“This is what a flat curve looks like,” Wachter said Friday. “And I think everybody’s a little reluctant to talk about it too much because we’re really hoping our good fortune continues and we’re absolutely hoping that people don’t change their behavior too soon.”

Governor issues early statewide stay-at-home order

LOS ANGELES, CA - NOVEMBER 06: Democratic gubernatorial candidate Gavin Newsom speaks during election night event on November 6, 2018 in Los Angeles, California. Newsom defeated Republican Gubernatorial candidate John Cox. (Photo by Kevork Djansezian/Getty Images)
California governor orders residents to stay at home
00:55 - Source: CNN

On March 19, Californians were ordered not leave home except for essential needs.

“This is a moment where we need some straight talk,” Newsom told reporters at the time. “As individuals and as a community, we need to do more to meet this moment.”

On the list of entities allowed to stay open were groceries, pharmacies, gas stations, farmers markets, food banks, convenience stores, delivery restaurants, banks, some local government offices and law enforcement agencies.

Nonessential services such as dine-in restaurants, bars, gyms and convention centers shut down under the order.

New York state did not issue a stay-at-home order until March 20. It took effect two days later.

Wachter added, “Southern California is somewhat worse than Northern California but still a far, far cry from New York and New Jersey and Michigan. And what we’re beginning to see in Florida.”

The Los Angeles County Department of Public Health on Friday reported 4,566 cases, with 89 deaths.

Health department director Dr. Barbara Ferrer said Friday the county expects 1,000 new cases or more per day as it reaches its goal of testing 10,000 people a day.

This week, Los Angeles Mayor Eric Garcetti urged residents to wear non-medical grade face coverings when in public. President Donald Trump on Friday evening announced his administration was recommending Americans wear “non-medical cloth” face coverings.

Dr. Robert David Siegel, a professor in the Department of Microbiology and Immunology at Stanford University, said California was also aided in stemming the virus’ spread by strong and early public health awareness campaigns and a sprawling demography compared to places like New York City.

California’s efforts have been bold and controversial but appear to be working, Wachter said last week.

“There were people that said, ‘Why are you doing this? You’re going to kill the economy,’” he said. “I think there’s just a general attitude – let’s trust the science. If this is what the science tells us, we need to take it very seriously.”

CNN’s Cheri Mossburg contributed to this report.