In a dramatic and unprecedented move, California issued a mandatory, statewide shelter-in-place order on Thursday after Gov. Gavin Newsom warned 56% of Californians — 25.5 million people — could be infected with coronavirus in the next two months.

The governor’s executive order means the most populous state in the nation will effectively shut down non-essential services — altering daily life for 40 million residents for the indefinite future. It allows Californians to continue to go outside to get food or medicine, to walk their dogs, to care for relatives and friends, to get health care.

Otherwise, though, Californians have to stay inside. The order is legally enforceable, meaning disobeying can result in a misdemeanor with up to $1,000 in fines or six months imprisonment, although Newsom said social pressures will likely be enough to encourage people not to gather in the middle of a public health crisis.

Newsom said he made the difficult decision based on modeling by state health officers and new data related to infection rates in the state. Similar shelter-in-place directives were already being used by a number of Northern California counties and the governor had previously asked seniors to stay home, but Thursday’s action now applies to everyone.

“Let’s bend the curve together,” the governor said in a livestream, referring to the effort to slow the spread of COVID-19 to prevent health facilities from being overwhelmed by patients. “Let’s not regret. Let’s not dream of regretting, go back and say, ‘Well, you know what, we coulda, woulda, shoulda.’ Not when the data all points to where I think most of us know we’re going.”

The directive was the culmination of swiftly escalating restriction in the face of an even more swiftly escalating peril. In just two weeks, Californians saw social gatherings limited first to 250 people, then only to the young and healthy, then locally outlawed in the Bay Area and some other counties. Sports events were canceled. Disneyland shut down for only the third time in history. Then millions of students were sent home from schools and colleges. Bars were told to issue their last call and restaurant seats emptied out.

It is unclear for the moment when normalcy will return, and Newsom’s executive order was much broader than many of shelter-in-place orders imposed earlier in the week by some cities and counties. What will remain open are the bare essentials: gas stations, pharmacies, grocery stores, banks and laundromats. Restaurants can offer take-out and delivery. About 500 members of the National Guard will be deployed for humanitarian work to help distribute food.

The governor said social media companies such as NextDoor will begin to provide informational kits to check in on neighbors and loved ones. AmeriCorps and the California Conservation Corps will also ramp up outreach to fight isolation, he said.

“One-pagers so you know what kinds of things you need at home to protect yourself, those that are socially isolated, our seniors struggling with loneliness, as much or more than anything else to make sure we reach out, maybe call five people a day, just check in on them,” Newsom said.

Newsom said his decision wasn’t made lightly. Rather, it came after weeks of effort in collaboration with the Centers for Disease Control and Prevention to model the spread of the novel coronavirus in California, according to Health & Human Services Secretary Mark Ghaly.

“And we are very glad we had built that model,” Ghaly said. “It’s put us in a great position with our partners across the state to be prepared for what we are starting to see, which are hospitals with many patients, and patients who are in the ICU and having outcomes that we’ve seen in other countries.”

Earlier in the day, the governor said he had warned President Donald Trump that more than half of Californians — 25.5 million people — could be infected with coronavirus over the next two months as he sought at least $1 billion in federal aid from congressional leaders.

“If we change our behaviors, that inventory will come down,” Newsom said. “If we meet this moment, we can truly bend the curve to reduce the need to surge, to reduce the need to have to go out and to cobble all those assets together.”

In a letter dated Wednesday, California’s governor requested White House assistance to deploy the USNS Mercy hospital ship to Los Angeles as health officials project the state will fall short of hospital beds needed to handle a surge in COVID-19 cases. In the last 24 hours, the state reported 126 new cases, a 21% increase, and the rate is doubling every four days in some areas.

“We project that roughly 56 percent of our population — 25.5 million people — will be infected with the virus over an eight week period,” Newsom wrote.

Newsom also sent a separate letter to the leaders of the U.S. Senate and House of Representatives seeking at least $1 billion in federal funds to support California’s response to the pandemic. The money, he said, is needed to purchase and set up health care facilities that the state projects it will need to treat a flood of patients. This includes using state-run hospitals, mobile hospitals and retrofitting hotels and motels.

The governor also asked for additional congressional support to help families and low-income households cope with the crisis by extending unemployment insurance, increase reimbursement for Medi-Cal, the state’s Medicaid program, suspend work requirements for food stamps as families go hungry and allocate more funding for nutrition programs for children and seniors.

Newsom also called for loans for small businesses and technology and broadband funding for school districts with high concentrations of families in poverty as schools scramble to adapt to online learning or studying at home.

State health officials estimate that California hospitals have the capacity to handle a surge of about 10,000 people. However, some models project the state could need twice that, closer to 20,000 extra hospital beds.

He announced a series of steps being taken to bridge that gap. They include ramping up hospital beds by leasing motels and hotels, borrowing university dorms, staving off hospital closures and asking the federal government for two mobile hospitals in addition to the naval hospital ship.

He announced Seton Medical Center in Daly City, which had been slated for closure by Verity Health Systems, would continue operating and said a second hospital in Southern California would be named on Friday.

While government officials are conferring with pharmaceutical companies such as Gilead in seeking treatments, Newsom said he “was pleased” to see Tesla’s CEO Elon Musk tweet about the possibility of producing ventilators. Musk said Tesla’s cars contain sophisticated ventilation systems and SpaceX, his spaceflight company, makes life support systems.

“Ventilators are not difficult, but cannot be produced instantly,” Musk replied.

In Newsom’s letter to the president, the governor asked that the naval hospital ship be deployed to Los Angeles because it will free up beds at existing hospitals and health facilities to respond to acute care needs, such as heart attacks and strokes or car accidents.

Newsom sought to strike a chord with the president’s hometown.

“The population density in the Los Angeles Region is similar to New York City, (and) will be disproportionately impacted by the number of COVID-19 cases,” Newsom wrote.

CalMatters reporter Rachel Becker contributed to this report.