California’s 40 million residents should stay home indefinitely and venture outside only for essential jobs, errands and some exercise, governor Gavin Newsom has said.

The move, the most sweeping by any US state so far, came amid warnings that the coronavirus threatens to overwhelm the region’s medical system.

“I can assure you home isolation is not my preferred choice, I know it’s not yours, but it’s a necessary one,” Mr Newsom said at a news conference streamed on social media.

He assured residents that they “can still take your kids outside, practising common sense and social distancing. You can still walk your dog”. Restaurant meals can still be delivered to homes.

New York state later joined California in ordering nearly all residents to stay home. Governor Andrew Cuomo said New York is going to “close the valve” because its hospital system could become overwhelmed.

Meanwhile, Donald Trump has invoked the Defence Production Act to get needed medical supplies on the front lines of the outbreak, mobilising the federal government to marshal the private sector.

The president also announced an effective closure of the US border with Mexico, prohibiting most travel except for trade, bringing it in line with the restriction on the Canadian border earlier this week.

Mr Trump, addressing reporters at the White House, also announced a suspension of federal standardised testing for students and assistance on federally owned student loans.

Donald Trump
Donald Trump (Evan Vucci/AP)

The announcement in California came after the release of a letter to Mr Trump in which Mr Newsom warned the virus was spreading quickly and could infect more than half the state’s population.

A spokesman later clarified that the figure did not take into account the aggressive mitigation efforts that have been made.

The governor said he does not expect police will be needed to enforce his stay-at-home order, saying “social pressure” has already led to social distancing throughout the state.

“I don’t believe the people of California need to be told through law enforcement that it’s appropriate just to home isolate,” he said.

The Democrat, who is barely a year into his first term, also called up 500 National Guard troops to help distribute food, after panic buying led to massive queues at some grocery stores.

Gavin Newsom
Gavin Newsom (Rich Pedroncelli/AP)

Mr Newsom also outlined a series of steps aimed at providing more space for hospital patients.

He said the state has taken over a 357-bed bankrupt hospital in the San Francisco Bay Area, will soon announce the purchase of a similarly sized hospital in southern California and may use dormitories at the state’s public colleges and universities.

He also asked Mr Trump to dock the navy’s 1,000-patient Mercy hospital ship in the Port of Los Angeles.

There are at least 1,030 confirmed cases in California and 18 people have died, according to a tally by Johns Hopkins University.

Mr Newsom’s statewide order came after counties and communities covering about half the state’s population already had issued similar edicts. He said the restriction is “open-ended” because it could raise false hopes if he included an end date.

He did offer a glimmer by saying he did not expect it would last “many, many months”.

HEALTH Coronavirus
(PA Graphics)

In the letter to Mr Trump seeking the hospital ship, Mr Newsom said California’s infection rates are doubling every four days in some areas and that 56% of the state’s population could contract the virus in the next eight weeks, which would be more than 22 million people.

He later said the “overwhelming majority won’t have symptoms” and will be fine but that up to 20% could need to be admitted to hospital.

Mr Trump has asked states to do more to secure their own critically needed masks, ventilators and testing supplies as pressure mounted on hospitals.

The State Department also issued a new alert urging Americans not to travel abroad under any circumstances, and Mr Trump said the government should take partial ownership of companies bailed out during the pandemic – an extraordinary federal reach into the private sector.