Officials in six San Francisco Bay Area counties issued a sweeping shelter-in-place mandate Monday affecting nearly 7 million people, ordering residents to stay at home and go outside only for food, medicine and outings that are absolutely essential.

The order says residents must stay inside and venture out only for necessities for three weeks starting Tuesday in a desperate attempt by officials to curb the spread of the novel coronavirus. Read the order issued in Santa Clara County here.

Officials in six Bay Area counties have issued a shelter-in-place order designed to slow the spread of the novel coronavirus. Here’s a look at what you need to know about the mandate.

“I know today’s order is a radical step. It has to be. We need to act now, all of us, to protect the public health,” said Dr. Grant Colfax, director of the San Francisco Department of Public Health.

It affects the counties of San Francisco, Marin, Santa Clara, San Mateo, Contra Costa and Alameda, which includes the cities of Berkeley and Oakland.

“History will not forgive us for waiting an hour more,” said San Jose Mayor Sam Liccardo, whose city is the most populous in the Bay Area and also the epicenter of the area’s outbreak. “This is our generation’s great test, our moment to stand tougher as a community. Amid our collective fears, we will find our uncommon courage.”

Bay Area authorities issue a shelter-in-place order due to the coronavirus.

San Mateo Mayor Joe Goethals told NBC News residents must stay at home and not report to work unless they have essential jobs including health care works, first responders and other key personnel to keep government services running.

"Everyone needs to go home and stay home," Goethals said.

San Francisco Mayor London Breed criticized what she called a “terrible response” by federal officials.

“We can’t sit back and wait for the federal government to do anything. Unfortunately, they have not been as proactive as they should in recognizing this is a crisis throughout the world,” she said.

The order tells people to work from home unless they provide essential services such as public safety, sanitation and medical services.

“Grocery stores will remain open, banks will remain open, the pharmacies will remain open. There is no need to panic,” Breed said.

But daily life will change dramatically in what Breed called the “new normal, temporarily, to protect public health.”

Most people will have to work from home. The order says residents can go out only for “essential activities” — like buying food, seeing a doctor or caring for a family member — and only “essential” businesses and government functions can remain open, including health care, public transportation, hardware stores, garbage collection, gas stations, laundromats and banks.

In an attempt to slow the spread of the novel coronavirus, a stay-at-home order has been issued in San Francisco and other parts of the Bay Area.

Restaurants will be open only for takeout.

All gyms and bars will have to close. Outdoor exercise is fine, as long as people practice social distancing, Colfax said.

California’s national parks and state parks remained open, but many parks said they were shutting indoor spaces, including visitor centers and museums.

“You can still walk your dog or go on a hike with another person, as long as you keep 6 feet between you,” Colfax said. He said officials from the six counties met over the weekend and determined the unprecedented measures were necessary to slow the virus’ spread, shield those most vulnerable to the disease and protect health care workers who are on the front lines of fighting it.

Kevin Jones, general manager of Buena Vista Cafe, an iconic San Francisco restaurant that has been a draw for tourists since 1952 in the popular Fisherman’s Wharf, said the order is “going to hurt, but our duty is to protect our employees and our customers.”

The cafe was the only one open Monday in one of the city’s busiest tourist areas, and was almost full. He said he’s worried about its 58 employees being able to pay their rent; owners and managers decided any perishable foods would go to the workers.

The dramatic step came as officials across California took increasingly strident steps to separate people and contain the spread of coronavirus.

On Sunday, Gov. Gavin Newsom urged the state’s 5.3 million people who are 65 and older and those with chronic health conditions to isolate at home. He also called for all bars, wineries, nightclubs and brewpubs in California to close.

California has confirmed at least 335 cases of the virus and seven deaths. The virus usually causes only mild or moderate symptoms, such as fever and cough, but can be deadly for older people and those with underlying health conditions.

Most of California’s public schools were shut starting Monday for several weeks. Newsom said an estimated 85% of California’s 6 million public school students will be out of their classrooms this week. Many districts are arranging for meal pickups for families that depend on schools for breakfast and lunch.

For more information about COVID-19 activities in these areas, visit the Alameda, Contra Costa, Marin, Santa Clara, San Francisco, San Mateo, or Berkeley COVID-19 websites.