LOS ANGELES — America’s most populous state is ordering its residents to stay indoors.

Gov. Gavin Newsom of California on Thursday ordered Californians — all 40 million of them — to stay in their houses as much as possible in the coming weeks as the state confronts the escalating coronavirus outbreak. The order represents the most drastic measure any governor has taken to control the virus, and a decision that Gov. Andrew M. Cuomo of New York, which has far more cases than California, has resisted taking.

Mr. Newsom made the announcement from the state’s emergency operations center in Sacramento, normally a place where emergency workers coordinate responses to wildfires and earthquakes, and spoke in stark terms of the risk that the coronavirus posed to the population.

Citing a model that state planners have been using, suggesting that 56 percent of Californians, or more than 25 million people, could be infected over eight weeks, Mr. Newsom said, “I think it’s time I tell you what I tell my family.”

“This is not a permanent state, this is a moment in time,” he said. “We will look back at these decisions as pivotal.”