LOS ANGELES — A smattering of rain and easing temperatures helped more than 1,000 firefighters battling the largest wildfire in Los Angeles history gain the upper hand on the blaze Sunday, but officials warned that danger remains.

“We’ve turned the corner, but this is not over,” Los Angeles Mayor Eric Garcetti told reporters. “With winds this strong, anything can happen.”

Shifting winds could cause burning embers to spread the fire once more through the rugged northern edge of Los Angeles, Garcetti said.

The nearly 5,900-acre La Tuna Fire, named after the canyon area where it erupted Friday, has destroyed three homes and damaged one. More than 700 homes were evacuated as the blaze tore through thick brush that has not burned in decades.

Of the 1,400 people evacuated from their homes, 90 percent had returned by Sunday afternoon and Garcetti said nearly all would be back before the day was over.

The wildfire is the largest in terms of acreage in the city’s history, Garcetti said. It was considered 30 percent contained by late Sunday night, up from 10 percent Sunday morning.

“We do not have this fire contained,” Garcetti said, “but we do have a good sense of, in the next day or two, how we can bring this fire to rest.”

The stretch of the 210 freeway, a major thoroughfare that has been closed for several days, will reopen either Sunday night or Monday morning, Garcetti said.

Los Angeles County, home to 10 million people and vast tracts of undeveloped mountainous land, has suffered much larger wildfires that have burned for weeks.

California Gov. Jerry Brown on Sunday declared a state of emergency for Los Angeles County, which will ease the path for state and federal help to fight the fire.

Temperatures in the area have hovered around 100 degrees Fahrenheit in recent days. But the mercury was in the low 90s on Sunday, and the temperatures are expected to be moderate and the humidity higher in the coming days, positive signs for containing the fire, Los Angeles fire Chief Ralph Terrazas said.

Garcetti said four firefighters had suffered dehydration or minor burns.

More than 400 miles to the north, the so-called Ponderosa Fire has burned 4,000 acres and destroyed 32 homes in Butte County since it started Tuesday, prompting evacuation orders to residents of about 500 homes. The blaze was 64 percent contained Sunday evening, up from 56 percent earlier in the day.