Just hours after Santa Clara County reported its first coronavirus-related death, the county has implemented a mandatory ban on all large gatherings in hopes of containing the spread of the deadly virus — the most sweeping preventive measure yet taken in California.

The ban, which will begin at midnight on Wednesday and span at least three weeks, will apply to any “mass gathering” event with more than 1,000 attendees, Santa Clara County Counsel James Williams announced at a press conference Monday evening. The Santa Clara County Sheriff’s Office and police departments throughout the county will enforce the ban.

The county has defined a “mass gathering” as anything that brings together 1,000 or more people in a single room or single space at the same time, such as an auditorium, stadium, arena, theater, or any other “confined indoor or confined outdoor space.” The ban does not include normal operations at airports, shopping malls and centers, offices or other spaces where 1,000 or more persons may be in transit.

In the midst of the growing global outbreak, the ban is one of the most sweeping precautionary measures put in place by any region in the country, but other American cities have been heading in the same direction in recent days.

Last week, the city of Austin forced the cancellation of the popular South by Southwest music festival. And the city of San Francisco has temporarily banned all large events in city-owned buildings — a move that has forced the San Francisco Symphony and Ballet to cancel all performances through March 20. But that city has not gone so far as to restrict events in privately owned facilities, including Golden State Warriors games and shows such as “Hamilton” and “Harry Potter and the Cursed Child.”

Santa Clara County officials say the two main goals of the ban — which they had instituted on a voluntary basis a week ago — are to reduce the number of infections and slow the spread of the virus in the community.

“Slowing the spread is critically important because it enables people, businesses, educational institutions and the health care system to prepare and institute measures to keep functioning while social distancing measures are in effect,” Sara Cody, the county’s health officer, said during the press conference.

Santa Clara County is one of a handful of areas in the country where there have been documented instances of community transmission — meaning the COVID-19 virus is circulating and passing from person to person here.

The ban will apply to San Jose Sharks games and other events planned for San Jose’s SAP Center. The ban will not be enforced at airports, shopping centers or any place where people are in transit, county officials said. They also said they are not recommending the closure of schools.

Events planned for March at the SAP Center that will be impacted by the ban include three Sharks games, two Barracuda games, five nights of Cirque de Soleil, four performances by motivational speaker Tony Robbins and a Marc Anthony concert. Robbins had canceled his performances earlier Monday, saying that Santa Clara County is a “hot zone.”

It is unclear at this time whether the San Jose Sharks will play their games as scheduled but to an empty arena, the way sports teams have done in Japan. County officials said Monday they would allow sports teams to play without fans. A team official said Monday night that the Sharks — who operate the arena for all events, as well as playing games there — have not made a final decision on how or whether to play.

“We will adhere to the mandated guidelines,” SAP Center said in a statement. “We will be reviewing each scheduled event due to take place for the rest of the month and provide an update in the coming days. We appreciate the understanding and patience of our fans, guests and partners during this unprecedented time.”

The San Jose Earthquakes would also be affected, but team officials could not be reached Monday night.

Officials said they will reevaluate the ban at the end of the month as more widespread testing becomes available and they learn more about the spread of the virus.

Robert Siegel, a Stanford professor of microbiology and immunology who studies viruses, said the ban on large gatherings was “very prudent.” Siegel predicted that other local governments around the country would follow Santa Clara’s lead. “I don’t think we’ve seen the end of this,” he said. The measures local governments take are “going to get more aggressive by the day.”

Earlier on Monday, a Santa Clara County resident with a confirmed case of coronavirus died, becoming the second virus-related death in California.

The patient was a woman in her 60s with chronic health conditions and had been hospitalized for a respiratory illness for several weeks, according to a news release from the Santa Clara County Public Health Department. She died at Mountain View’s El Camino Hospital on Monday morning.

She was the county’s third reported case of coronavirus and its first without any known international travel history or contact with a traveler or infected person, “suggesting she contracted COVID-19 in our community,” the release stated.

Santa Clara County also reported five newly discovered cases on Monday, bringing its total to 43 — the highest of any county in the Bay Area.

“We are clearly facing a historic public health challenge, and we know this is a very difficult time,” Cody said after offering her condolences to the woman’s family. “I want to reassure all county residents that the public health department is taking necessary and carefully considered steps to slow down the spread of disease and protect everyone, most importantly those at greatest risk.

“Our top priority continues to be protecting the health of the community.”

Contra Costa County and San Mateo County have also discouraged large public gatherings because of COVID-19.

California state officials have taken a more modest tack than Bay Area local governments, suggesting only that the elderly or people with chronic medical conditions take precautions and “stay home as much as possible.” Gov. Gavin Newsom’s office didn’t respond to requests for comment Monday about whether Newsom is considering any more stringent measures.

Elsewhere around the world, governments in virus-plagued countries have put in place far more draconian measures. Italy has banned individuals around the country from leaving their homes other than for work or medical reasons, and China has locked down the disease’s epicenter of Wuhan Province.

If the disease escalates, such measures aren’t out of the question in the U.S. Dr. Anthony Fauci, the director of the National Institute of Allergy and Infectious Diseases, said Sunday that “We’ve got to be prepared to take whatever action is appropriate to contain and mitigate the outbreak.”

Reporters Casey Tolan and Joan Morris contributed to this story.