California Gov. Gavin Newsom on Thursday evening announced he's enacting a "statewide order" for its nearly 40 million residents to "stay at home," a wide-reaching measure for the most populous state in the country as the coronavirus spreads.

The order took effect midnight on Friday morning. It prohibits gatherings outside and requires nonessential businesses to close in an effort to slow the spread of the virus.

“We need to bend the curve in the state of California,” Newsom said during a news conference. “There’s a social contract here. People, I think, recognize the need to do more. They will adjust and adapt as they have.”

He added, “This is a moment we need to make tough decisions. This is a moment where we need some straight talk and we need to tell people the truth.”

Public events have been canceled and bars, dine-in restaurants, gyms and clubs will be closed. Essential services such as grocery stores, pharmacies and banks will stay open.

Newsom's office projected the virus will infect more than half of Californias within two months, according to a letter he sent to President Trump on Wednesday where he said the state has been disproportionality impacted.

"In some parts of our state, our case rate is doubling every four days," he wrote Trump.

Newsom's order came just after Los Angeles County officials announced a near-lockdown of the county, affecting 10 million residents who were urged to stay home except in cases when they need to go outside for essential needs.

"We're about to enter into a new way of living here in Los Angeles," Mayor Eric Garcetti said at a news conference. "What we do and how we do it and if we get this right will determine how long this crisis lasts."

On Wednesday, Newsom directed $150 million to go toward local governments for emergency housing and shelter support for homeless individuals. San Francisco officials on Monday ordered the country's first "shelter in place" order.

Statewide, more than 900 people have contracted the virus and 19 have died. More than 10,000 people have been infected nationwide.