CHICAGO (AP) — Illinois Gov. J.B. Pritzker on Friday ordered all state residents to remain in their homes except for essentials, matching similarly dramatic efforts in California and New York to limit the spread of the coronavirus.

Pritzker’s order, which takes effect Saturday at 5 p.m. and is set to expire April 7, allows the state’s 12.6 million residents to head outside to buy groceries and medicine.

“If there are actions that I can take that will save lives in the midst of this pandemic, no matter how difficult, then I have an obligation,” Pritzker said. The Democrat said he was trying to prevent “potentially tens of thousands” of deaths but urged people not to panic.

“For the vast majority of you already taking precautions, your lives will not change very much,” he said, adding that people can continue to shop for groceries, visit pharmacies and gas stations and exercise outdoors. People also can continue to pick up meals from restaurants, he said.

Pritzker acknowledged that the state doesn’t have the resources or “the desire” to enforce the order to limit individuals’ actions, but he said law enforcement will take action if necessary.

The stay-at-home order will also mean schools statewide remain closed until April 8, he said.

Pritzker had previously ordered all schools statewide to shut down through the end of March and limited gatherings to 50 people to curb the spread of the coronavirus in the state. He also closed dine-in service at bars and restaurants, but allowed businesses to continue delivery or carryout options.

The governors of California and New York, Gavin Newsom and Andrew Cuomo, have issued similar orders.

Chicago Mayor Lori Lightfoot, who stood by Pritzker’s side as he announced the order, said she agreed with the decision.

“Think of this as ‘safer at home,’ ” she said.

“This is not a lockdown or martial law,” said Lightfoot, addressing, as Pritzker had, rumors to that effect. “The grocery stores will remain open and stocked, so please be mindful of [the needs of] your neighbors,” rather than emptying out store shelves and hoarding.

Outdoor activity including walks, the mayor said, remains permissible, provided participants practice “social distancing.”

For most people, the coronavirus causes only mild or moderate symptoms, such as fever and cough. For some, especially older adults and people with existing health problems, it can cause more severe illness, including pneumonia.

The vast majority of people recover from the virus. According to the World Health Organization, people with mild cases recover in about two weeks, while those with more severe ones can take three to six weeks to get better.

As of Friday afternoon, Illinois reported 585 cases of COVID-19 in 25 counties, and five deaths. The latest patient to die is a woman in her 70s from Cook County.