Smoke from nearby wildfires smothered the San Francisco Bay Area with “unprecedented” levels of air pollution Thursday, with readings in some areas as bad as notoriously smoggy Beijing.

The Bay Area Air Quality Management District issued a health advisory for a second straight day and extended it through the weekend, saying “very unhealthy air quality from the wildfires in the North Bay is causing unprecedented levels of air pollution throughout the Bay Area,” and advised residents to stay indoors, if possible, and to close windows and doors.

In San Francisco, ash coated car windows and sunlight was filtered an eerie orange. Conditions were only expected to get worse.

“We’re going to see a really strong settling of the smoke in the Bay Area on Friday and Saturday,” National Weather service meteorologist Brian Garcia told the San Francisco Chronicle. “Not to mince words. It’s going to be really bad. It’s not going to be fun.”

Children, the elderly and those with respiratory conditions were said to be the most at risk, especially from particulate matter that can penetrate deep into the lungs. A number of school districts in the area canceled classes, and many that did not kept children inside.

Thursday afternoon, the U.S. Environmental Protection Agency’s air quality index rated San Francisco air at 161, or “unhealthy,” comparable to levels typically seen in Beijing, widely considered the city with the world’s worst air pollution. In San Jose, about 100 miles from the fires, air quality rated at 101. By comparison, on Friday local time, Beijing’s air rated a 91.

Many people around the Bay Area were seen wearing face masks, which quickly sold out at local hardware stores, Business Insider reported.

Smoke affected flights at San Francisco International Airport for a second day, causing more than 100 cancellations and delays averaging more than two hours. Airports in Oakland and San Jose were unaffected.

The smoke was being blown south largely from Napa, Sonoma and Mendocino counties, where a cluster of wildfires continued to burn for a fourth day. The death toll rose to at least 31, with hundreds more people still missing. The mayor of Santa Rosa, a city of 175,000 about an hour north of San Francisco, estimated more than 2,800 homes had burned in that city alone, and officials fear that number could grow.

“We all have suffered a trauma here. We’re going to be a long time recovering from this incident,” Mayor Chris Coursey said. “The city of Santa Rosa has suffered a serious blow in these fires.”

Read: With climate change and sprawling property development, wildfires are here to stay

Also see: California wildfires threaten thousands of homes worth tens of billions, CoreLogic says

The Wine Country blazes were among 16 wildfires raging in Northern California, burning more than 191,000 acres. More than 8,000 firefighters were being aided by better weather conditions, as high winds that had been expected overnight never materialized.

On Thursday, fire crews appeared to have saved the town of Sonoma and its historic downtown from approaching flames. Large parts of the Sonoma Valley were still under mandatory evacuation orders, as was the resort town of Calistoga, known for its mineral springs.

The effect on the region’s world famous wineries and vineyards is still unknown, as the damage is still being assessed in many places.

A number of Silicon Valley companies are pitching in for wildfire relief. Salesforce.com Inc. CRM, -0.71% on Thursday said it has set a goal of $2 million in donations to support rebuilding and relief, including $500,000 for schools from the company’s philanthropic arm and $500,000 from founder and CEO Marc Benioff and his wife, Lynne. The company said it hopes to raise another $500,000 from employee contributions, and will match those donations.