Growing wildfires in California forced evacuations as a heat wave Wednesday threatened to make fire conditions worse. In the Midwest, a wildfire kept residents of South Dakota’s second-largest city on edge, ready to flee if flames moved dangerously close.

A blaze near the remote Northern California mountain community of Sierra Brooks was uncontained. Authorities expanded evacuation orders for a total of more than 530 residents Tuesday evening after strong winds pushed flames through dry brush and timber about 50 miles north of Lake Tahoe. The Bear Fire grew to more than 4.7 square miles and sent up a plume of smoke visible some 25 miles away in Reno, Nevada.

“Due to steep and rocky terrain, crews have experienced difficulty in gaining access to some areas of the fire, slowing progress,” the U.S. Forest Service said in a statement. Flames damaged power lines, knocking out electricity to more than 750 residents, the service said.

In central California, firefighters working in triple-digit temperatures were battling a blaze that scorched more than 17 square miles of dry brush in mostly open space. A handful of homes were evacuated outside of Coalinga in Fresno County. The Boone Fire was 5% contained Wednesday.

Across the state, red flag warnings for increased wildfire risk were issued. The desert communities of Palm Springs, Twentynine Palms, Needles and Barstow were heating up, with highs of up to 118 F in Death Valley’s Furnace Creek expected at week’s end.

In Southern California’s Santa Barbara County, officials issued a health alert due to spiking temperatures in inland areas. The health department urged residents to stay indoors during the day and take other measures to avoid heat-related illnesses. Cooling centers were set up across Los Angeles County.

The wildfire news was better in South Dakota: The battle to contain the First Thunder Fire got a boost Wednesday from cooler weather and lighter winds. Officials were optimistic homes in Rapid City would remain safe.

The First Thunder Fire was reported Monday just a few miles from Rapid City, a community of 80,000 residents near Black Hills National Forest. Mount Rushmore National Memorial, about 25 miles away, is far out of harm’s way.

The fire burning nearly 160 acres was fueled by uncommonly hot and dry weather — Tuesday’s high in Rapid City was 96 degrees Fahrenheit, well above the normal early-September high of 75. Winds gusted to 45 mph.

As late as Tuesday evening, residents in an evacuation warning area of Rapid City were being told to pack their bags, gather vital belongings and be prepared to leave at a moment’s notice.

By Wednesday morning, the temperature was far cooler, the winds calmer and the air more humid.

“Firefighters got a good handle on the wildfire last night,” an update from the Pennington County Sheriff’s Office said. “It’s currently at 157 acres. Weather conditions are very favorable today. They are mopping up a large portion on the west side and are hoping to get everything contained and under control today.”