Updated

A pair of wildfires flared and thousands of residents fled amid drought conditions and spiking heat in California, but both blazes had calmed as night fell and the winds that had whipped them diminished.

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 the 1,200 homes and businesses told to evacuate in Santa Barbara County had been allowed to return.

The two blazes, 250 miles apart, each grew to 700 acres and each was 5 percent contained, but the San Diego-area fire was much closer to much more populated areas, and the rugged terrain and unseasonably warm temperatures made firefighting difficult, creating some scary moments that quickly passed.

Neither blaze caused any home damage or injuries, but another hot, dry day is expected Wednesday.

"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 the nearly firefighters, said David Sadecki of the Santa Barbara County Fire Department.

Chrissy Cabral, 57, rounded up friends to help her remove 19 head of cattle she keeps at a local 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 five miles away, Cabral said.