Schools in the San Francisco Bay Area have been cancelled for Friday and residents warned to stay inside as smoke descends from wildfires hundreds of miles away, producing air quality levels worse than notoriously polluted cities in India and China.

“The Camp fire in Butte county generated a tremendous amount of smoke,” said Kristine Roselius, a spokeswoman for the Bay Area Air Quality Management District. “That smoke is just pouring into the Bay Area right now.”

Officials in San Francisco, Oakland, Sacramento and other districts announced Thursday that schools will remain closed on Friday.

San Francisco’s transit agency, meanwhile, halted the operation of the city’s famous cable cars in order to protect “the safety and health of our customers and employees”. The local department of public health advised, “People should remain indoors with windows closed, and continue to remain indoors until air quality improves.”

Air quality levels, which are described on a scale from green (good) to red (unhealthy), purple (very unhealthy), and maroon (hazardous) have been red for much of the week, since the wildfire, the deadliest in California history, began on 8 November.

But as the wind shifted south on Thursday, the heavily populated cities to the south of the fire saw pollution levels climb into the purple and, in Sacramento, maroon levels. A ranking of air quality in major world cities for 15 November ranked San Francisco worst, ahead of Delhi and Lahore.

A man wears a mask while waiting for public transit in Alameda, California Photograph: Ben Margot/AP

Roselius explained that the air quality is worsening in part because of a temperature inversion that is trapping the smoke in cold air over the Bay Area.

“Warmer air is above the colder air,” she said. “It acts like a lid. It basically just traps it right there, and we keep getting new smoke.”

The smoke is expected to be even worse Friday, and will likely remain at unhealthy levels through next week.

“Even the healthy among us are impacted,” Roselius said. Fine particulates can cause immediate health impacts, especially among children, the elderly, and people with respiratory conditions.

Demand for particle-grade face masks has soared, but experts warn that masks are not a substitute for staying indoors, and that they are not appropriate for children or people with beards.