The California Independent System Operator (California ISO), which manages the power grid, declared an emergency shortly after 6:30 p.m. and directed utilities around the state to shed their power loads.
Pacific Gas & Electric, the state's largest utility, tweeted that it would turn off power to about 200,000 to 250,000 customers in rotating outages for about an hour at a time. Other utilities were told to do the same.
RELATED: Bay Area power restored after rolling outages leave thousands in the dark
The emergency declaration ended just before 10 p.m. and California ISO said power had been restored statewide.
"Extreme heat is really the driver behind this," said Anne Gonzales, spokeswoman for the power grid operator.
The move came as temperatures around the state hit triple digits in many areas, and air conditioning use soared.
Temperatures were 10 to 20 degrees above normal in some areas, Gonzales said.
In addition, cloudy weather from the remnants of a tropical weather system reduced power generation from solar plants, she said.
The state tried to prepare for the expected rise in electricity use by urging conservation and trying to buy more power but a high-pressure system building over Western states meant there was less available.
Temperatures and energy use were expected to drop during the evening, and California ISO expected the outages to end at midnight.
The heat wave is expected to last through next week and the power grid operator will decide whether to continue the rolling outages on a day-to-day basis, Gonzales said.
"We're dealing with weather, clouds, wildfires ... these are quickly evolving situations, quickly changing," Gonzales said.
The last time the state ordered rolling outages was during an energy crisis in 2011. Blackouts occurred several times from January to May, including one that affected more than 1.5 million customers in March. The cause was a combination of energy shortages and market manipulation by energy wholesalers, infamously including Enron Corp., that drove up prices by withholding supplies.
RELATED: What is a Flex Alert?
Counties up and down the state reported scattered outages, although the city of Los Angeles, which has its own power generating system, wasn't affected.
Police departments warned people to watch out on roads where stoplights were out.
In Sonoma County in the wine country, the Santa Rosa Police Department received a flood of calls and pleaded with residents: "Please do not call 911 unless you have an emergency."
The heat wave brought dangerously high temperatures, increased wildfire danger and fears of coronavirus spread as people flock to beaches and parks for relief.
Heat records fell in several cities. Downtown San Francisco hit 90 degrees, topping a high for the date of 86 that was set in 1995. Salinas hit 102, 18 degrees above the record set just last year. Palm Springs hit 120, breaking a 2015 record by several degrees.
RELATED: Bay Area hits record highs as blistering heat wave continues across region
Sweltering weather was expected to continue into Wednesday across greater Los Angeles, the Central Valley, Sierra Nevada foothills and parts of the San Francisco Bay Area.
Santa Clara, Alameda and Contra Costa counties opened cooling centers that will welcome people this weekend from the afternoon to the early evening. San Francisco officials said the city is recommending people stay home and that if the heat indoors gets intolerable to go outside to a shady place where they can stay cool and distant from other people.
"Congregate indoor sites are not safe necessarily during COVID-19. It is better to follow other instructions during this heat wave," said Mary Ellen Carroll, executive director of the Department of Emergency Management.
Carroll encouraged residents to check on family, friends and neighbors, especially older adults and those in frail health, and reminded people to always wear a face mask when in the vicinity of people who don't share their household.
"We know it's going to be beautiful out this weekend but we just want everyone to remember that we are in a very serious response to this COVID-19 virus," Carroll said.
VIDEO: Heat stroke vs heat exhaustion: What's the difference and what are the symptoms?
Los Angeles opened cooling centers, but with limited capacity because of virus social distancing requirements.
The scorching temperatures are a concern for firefighters battling blazes that have destroyed several homes and erupted near rural and urban foothill neighborhoods, driving through tinder-dry brush.
In addition to the possibility of heat stroke and other hot-weather illnesses, health officers were concerned that people will pack beaches, lakes and other recreation areas without following mask and social distancing orders - a major concern in the state that has seen more than 600,000 coronavirus cases.
Israel saw a COVID-19 resurgence after a May heat wave inspired school officials to let children remove their masks, Dr. George Rutherford, an epidemiologist at the University of California, San Francisco, told the San Francisco Chronicle.
"People will want to take off their masks when it's hot," Rutherford said. "Don't do it."
Watch the latest AccuWeather forecast and take a look at recent weather stories and videos.
RELATED STORIES & VIDEOS:
- Bay Area hits record highs as blistering heat wave continues across region
- Stage 2 emergency declared due to higher demand for power amid heat wave
- VIDEO: What is a Flex Alert?
- Heat stroke vs heat exhaustion: What's the difference and what are the symptoms?
- How hot can the inside of a car get in 10 minutes?