San Francisco’s 113 public schools — serving 54,000 students — will shut down for three weeks starting Monday to curb the spread of the coronavirus as the city struggles to prevent a surge in cases, the district announced Thursday.

The district was the first of six Thursday in the Bay Area to announce the closing of schools serving tens of thousands of students — and there were almost sure to be more in the coming days, along with other measures across the region reflecting the rapidly expanding response to the COVID-19 crisis.

On Friday, Oakland officials confirmed the district would also shut down as of Monday and several school districts across the Bay Area scheduled emergency meetings Friday as the pressure mounted to shut down to combat the spread of the coronvirus.

District officials in Orinda, Fremont, Dublin and Pleasanton were considering closure as well.

Also on Friday, the two largest districts in the state — Los Angeles and San Diego — issued a joint statement saying they too would shut down for three weeks.

The closures so far affect more than one million students in California who will be out of school in the coming weeks.

West Contra Costa Unified will close to more than 30,000 students for three weeks starting Monday. Berkeley Unified will close to 9,800 students for three weeks, and Tamalpais Union High School District, San Mateo Union High School District and Catholic schools run by the San Jose Diocese will close for two weeks.

Earlier in the week, San Francisco’s archidocese announced closures of 90 schools in the city and the counties of San Mateo and Marin.

In San Francisco’s public schools, the threat of the pandemic intensified Thursday night when officials announced that Glen Park Elementary would shut down immediately because seven students had “respiratory illness” and were being tested for COVID-19 by county health officials. The entire school’s students, families and staff were “asked to self-quarantine” for 14 days, according to a statement by the district.

The school closures in the Bay Area came as school districts across the country also shuttered to slow the spread of the pandemic.

“We’re watching the world around us as you are,” said Superintendent Vincent Matthews. “This is an evolving situation and we know it’s going to continue to evolve.”

The San Francisco decision followed the closure of Lakeshore Elementary School late Wednesday night after officials learned that four students there had respiratory illness, including pneumonia, and most likely have COVID-19, said school board President Mark Sanchez. Their family members were also showing similar symptoms.

The move shows how public officials are scrambling to react to the swift-moving situation.

“We are making the decision in the interest of keeping our students and families safe,” West Contra Costa Unified’s Superintendent Matthew Duffy said in a statement. “This was not an easy decision, but the uncertainty surrounding the outbreak has increased the confusion and anxiety in our community. .... The uncertainty around testing protocols and the availability of tests has heightened community concerns and fears.”

There are now 251 confirmed coronavirus cases in California, including 142 in the Bay Area, with 18 of those in San Francisco.

District officials noted that in recent days teacher and student absences dramatically increased, another factor in the decision.

“A lot of things came together to make this decision,” Sanchez said.

While the move to close schools may be prudent for public health, it will also present incredible hardships to families, and likely hurt disadvantaged families the most. Families will have to scramble for child care or juggle working from home while caring for their kids.

Officials urged families to avoid public places to reduce the possibility of exposure.

“This disruption should not be viewed as an opportunity to head to the nearest amusement park or movie theater,” Duffy said. “The only way that school closures can be helpful in arresting the spread of this disease is if everyone continues to follow the recommendations from our health experts.”

In San Francisco, the district will also start preparing teachers and staff for long-term plans to limit contact once school resumes.

The three-week closure, which includes spring break, will allow the district to more adequately prepare to deal with what will likely be many more cases of COVID-19 in the coming months, Matthews said.

Closing one school at a time as cases cropped up was not sustainable, the superintendent added.

“This will require a sustained effort,” Matthews said. “The board and staff determined to become preemptive and we know that we need time to prepare for this new world that we’re in right now.”

The closure will give the district time to stock up schools on supplies to deal with the virus, including hand sanitizer and tissues, and other products that are on back order.

Matthews said the districtwide closure would give principals and staff time to put in place additional procedures to limit personal contact in classrooms and on the playground.

Some staff would be required to report to work next week to put the new rules in place, then the next week teachers will return to school to undergo training and get ready for school to resume.

That is the current plan, Matthews said, noting how quickly a decision can become moot given the rapidly changing landscape surrounding COVID-19.

District officials said they are working on how to address the distribution of school meals and helping families with child care issues during the closure. More guidance would be coming, Matthews said.

The district will also provide information in the coming days on how families can help students learn during the closure. Online learning is not possible for all students because some have limited access to computers.

Given the anticipated lost learning time, district officials said they would ask the state superintendent to cancel annual standardized testing this year.

It’s also possible that the district could extend the school year by two weeks, said Sanchez.

The district’s teachers union supported the districtwide closure as cases across the city increased, said Susan Solomon, president of the United Educators of San Francisco.

“The amount of feedback and emails and calls have been growing, really in the last 24 hours,” she said.

Closing schools, however, requires many considerations, Solomon said, including ensuring paychecks continue and students can still access meals, which total 34,000 served daily.

The Lakeshore closure followed a Wednesday news conference with Mayor London Breed explaining why the district made the decision to keep all schools open despite calls from some parents and community members to close them for student and staff safety.

District officials have stressed that parents could keep their children home for any health reason, and their absences would be excused.

Schools across the region for the most part have remained open despite local decisions to limit large gatherings and Gov. Newsom’s recommendation Wednesday that Californians postpone or cancel all gatherings of 250 people or more.

On Thursday night, San Mateo County became the first county in the state to turn Newsom’s recommendation into a legal madate, issuing an order forbidding most gatherings of 250 people or more, effective at 11:59 p.m. Friday. The order is to remain in effect until April 3. The county had 20 reported cases of COVID-19 by Thursday.

The order by county Health Officer Scott Morrow said failure to comply with the ban on “public or private mass gatherings” above 250 people would constitute a misdemeanor punishable by fines or jail time. The directive is aimed at stadiums, theaters, meeting halls and the like, the order said — but exceptions are allowed for locations such as churches, shopping malls and other locations where people can maintain 6 feet of separation from each other.

San Francisco officials were expected on Friday to also issue an order banning all non-essential public or private gatherings of 250 people or more. On Wednesday, they issued an order banning gatherings of 1,000 people or more.

Schools are exempt from the mandates, and left to determine their own closures, because they are considered an essential service.

Education officials across the Bay Area, like their counterparts around the country, have struggled to balance the concerns over community health and the serious impact to families when schools close.

Dr. George Rutherford, head of the division of infectious disease and epidemiology at UCSF, said he has been advising San Francisco public health officials specifically about school closures, which included poring over studies on how they can effect disease outbreaks. School closures are especially challenging decisions during epidemics, Rutherford said, because they seem like such obvious sources of infection, but the fallout from shutting them down is among the most harmful interventions.

In the 2009 H1N1 pandemic, shutting down schools was less problematic than now because the outbreaks hit in California in May, toward the end of the school year.

Private schools as well as public districts across the region appeared poised to follow San Francisco and the other districts.

Some private schools have already shut down. On Tuesday, the San Francisco Archdiocese announced it would close all of its 90 schools through March 25 after a Riordan High School student tested positive for the coronavirus, a decision made without the advice of local health officials.

Officials at Seattle Public Schools closed all their campuses this week to prevent the spread of the virus.

Oakland officials sought to calm nerves after two high school students had potential exposure to a confirmed case of the virus. The schools, Oakland Technical High School and Oakland High School, remain open.

In San Francisco, the superintendent praised district and school staff for their professionalism and dedication.

“All staff — teachers, principals, administrative assistants, custodians, cafeteria workers, substitutes, administrators, para-educators, central office leaders, and more — are already going above and beyond to support our students and families,” Matthews said in a statement. “I am immensely grateful for their commitment to their school communities.”

Staff writers Erin Allday and Dominic Fracassa contributed to this report.

Jill Tucker and Kevin Fagan are San Francisco Chronicle staff writers. Email: jtucker@sfchronicle.com, kfagan@sfchronicle.com