AP

SAN DIEGO (AP) — Weather conditions that at least temporarily calmed allowed firefighters to gain ground early Wednesday on a pair of wildfires that forced thousands of residents to leave their homes.

Evacuation orders were lifted for all of the more than 20,000 residents in and around San Diego on Tuesday night just a few hours after they were called, and all but a handful of those in 1,200 homes and businesses told to evacuate in Santa Barbara County had been allowed to return.

The 1,550-acre San Diego-area blaze was 25% contained and it was hoped that number would increase to 50% by day's end, said San Diego Fire-Rescue spokesman Lee Swanson.

The 700-acre Santa Barbara County blaze, 250 miles to the northwest, was 5% contained.

Neither blaze caused any home damage or injuries, but another hot, dry and gusty day was expected as California baked in a spring heat wave as high pressure sat over the West.

"We believe we have a pretty good handle on it," San Diego Fire Chief Javier Mainar said. "We hope to do some more work through the night and into tomorrow, but I think the largest part of the emergency has passed."

The flames erupted in the fire-prone Rancho Bernardo area of the city, driven by hot, dry Santa Ana winds.

By late afternoon, the flames ripped through canyons to approach expensive homes and new subdivisions on the ridges. It spread to Rancho Santa Fe, one of the nation's wealthiest communities, known for its multimillion-dollar homes, golfing and horseback riding.

Black and gray smoke billowed over northern San Diego, filled with whirling ash and embers that created small spot fires. Flames crept within yards of some homes before firefighters doused them.

On one road, people on bicycles and skateboards stopped to watch as a plane dumped water on flames a half-mile away. At least two high schools and three elementary schools were evacuated.

Cameron Stout, filling his tank at a gas station, got a text from his wife shortly after noon saying that she was packing up and leaving with the family's pictures, laptops and other valuables. Their next-door neighbor's home burned in a fire 15 years ago, he said.

"This area's been through this before," he said. "I thought the recent rains would have prevented this from happening. But after a couple days of 100 degrees, it's reversed all that."

Katy Ghasemi, 14, was held for hours in her high school classroom before the school let the children go home. Students studied, ate lunch, did yoga and looked out the windows at the fire.

"There were a lot of flames. Some were right near the front gate," she said.

The city of San Diego issued between 16,000 and 17,000 evacuation orders, according to San Diego County Sheriff Bill Gore. Gore said the Sheriff's Department issued an additional 5,000 evacuation orders outside city limits. All the evacuations were called off by about 9 p.m.

Meanwhile, in the Santa Barbara County community of Lompoc, heavy brush and downed power lines provided special challenges for firefighters, said David Sadecki of the county Fire Department.

Chrissy Cabral, 57, rounded up friends to help her remove 19 head of cattle she keeps at a ranch after the fire shifted directions. She said firefighters warned her: "Get out now."

"It was very high flames, very dark," she said.

The group used trailers to move the cows 5 miles away, Cabral said.