Exceedingly dry and windy weather prompted Pacific Gas and Electric Co. to announce Tuesday night that it was shutting off power to several Bay Area communities, a move intended to prevent power lines from sparking disastrous wildfires like those that killed more than 100 people and destroyed thousands of properties in Northern California in the past two years.

PG&E said it would shut off power to 48,200 customers in Northern California — including in Sonoma and Napa counties — early Wednesday morning. Electricity shutoffs were to begin at 4:30 a.m. in the North Bay and 2:30 a.m. in the Sierra foothills. The outages are to last until noon, officials said, though under certain conditions, power might not be restored for 48 hours.

In all, seven Northern California counties were to be affected: Butte, Napa, Nevada, Placer, Plumas, Sonoma and Yuba. In the Bay Area, the utility said parts of Santa Rosa, Lake Berryessa, Napa and Calistoga would lose power — about 1,400 customers total in those areas.

The decision was met with criticism by some public officials.

Sonoma County Supervisor Shirlee Zane blasted the decision as gratuitous.

“PG&E is manufacturing a crisis and re-traumatizing our fire survivors in order to avoid liability,” Zane said Tuesday evening after the Santa Rosa outage was confirmed. “It is wrong and immoral.”

Wednesday is expected to be the “toastiest day” of the week, with temperatures reaching into the upper 90s and potentially higher, said Karleisa Rogacheski, a National Weather Service meteorologist. The biggest concern is the wind gusts and humidity levels. Humidity levels are expected to be between 10% to 30%, and wind gusts could reach 25 mph in the foothills and 40 mph in the mountains, Rogacheski said.

PG&E announced Wednesday’s shut-off — its second this week — after determining that “elevated weather conditions, including potential fire risk,” would be a risk to public safety.

After the dry, windy weather ends, PG&E said it will deploy crews to “visually inspect each mile of our power lines” to confirm that the lines are not damaged and are safe to re-energize. Officials will inspect power lines, poles and towers “by vehicle, foot and air.”

Crews plan to inspect the power lines during the daytime and aim to restore power within 24 to 48 hours, but officials said outages could last longer than 48 hours — depending on weather conditions or if repairs are required.

“Visual inspections are necessary since circuit breakers, reclosing devices and fuses that are typically used to help detect any potential damage from a weather event like a winter storm are also de-energized during a Public Safety Power Shutoff,” PG&E officials said.

PG&E said its workers are sometimes challenged by narrow access roads and areas with no vehicle access, and forced to hike to remote, “mountainous areas” to inspect equipment.

Power had been restored to “essentially all of the customers affected by the first” shut-off by about 6 p.m. Tuesday after PG&E initially shut off electricity for 24,000 customers due to dry and windy conditions ripe for fueling fires on Monday afternoon, said PG&E spokesperson Denny Boyles.

After the first outages that began Monday, crews started inspecting power lines and restoring electricity at 6 a.m. on Tuesday. With the assistance of 19 helicopters, 193 people inspected 1,357 power lines, Boyles said.

The National Weather Service issued a red-flag warning that remains in effect through 11 a.m. Wednesday for the North Bay mountains, East Bay hills and Diablo Range above 1,000 feet. These areas should prepare for extreme fire conditions, including very low humidity and gusty winds that could reach 40 mph.

Anna Schneider, a weather service meteorologist, said it’s hard to predict the likelihood of a fire.

“The point of the red flag is to say if a fire does start, it’s likely to spread pretty quickly,” she said.

On Tuesday, temperatures hovered in the upper 80s in downtown San Francisco and low 90s along the bay shoreline, while some inland areas in the north and east Bay Area saw triple digits. Humidity remained in the low teens to 20s, officials said.

In Butte County, PG&E left county offices’ power on during the first outage after “begging and pleading,” said Cindi Dunsmoor, an emergency services officer for the county.

A similar shut-off in June cut off power to the Sheriff’s Office, dispatch and government buildings, she said, forcing county officials to rely on backup generators to conduct essential government services.

This time, the county was more prepared, with plans in place if buildings lose power.

County employees conducted checks on vulnerable citizens to make sure everyone was aware of the outage, Dunsmoor said. Fire departments were on standby during the red-flag warning.

“We are going to go above and beyond what our normal staffing is,” said John Gaddie, a captain with Cal Fire in Butte County. “We are fully prepared to engage a fire if one breaks out.”

Lauren Hernandez, Anna Bauman and Sarah Ravani are San Francisco Chronicle staff writers. Email: lauren.hernandez@sfchronicle.com; anna.bauman@sfchronicle.com; sravani@sfchronicle.com