Helped by cooler, damp weather, firefighters gained the upper hand on a wildfire that has destroyed 77 homes since it was ignited -apparently by power tools - nearly a week ago.

As of Sunday, fire crews had established containment lines around about two-thirds of the blaze, which has charred over 8,700 acres in the foothills above the scenic and largely affluent coastal town 90 miles northwest of Los Angeles, authorities told reporters.

Less than a third of the fire had been corralled by late Saturday, after hot, dry, erratic winds abated, giving way to lower temperatures, fog and mist blowing in from the ocean. Firefighters also made headway overnight.

With the immediate threat to the city proper averted for the time being, most of the remaining 15,000 evacuees were permitted to return to their homes but were advised to remain ready to flee again at a moment's notice.

"We are not out of the woods yet," said Kelly Goethe of the California Department of Forestry and Fire Protection. "One little spark in 80-kph winds and we're right back to where we were a couple of days ago."

He said dangerous "sundowner" winds, which typically gust through mountain passes from the desert after nightfall, could reappear in the next couple of days. For that reason, most of the 4,200 personnel on the fire line would remain in place.

Later in the day, state fire officials issued a statement saying the cause of the fire "appears related to the use of power tool equipment involved in vegetation clearance," and asked the public for information about anyone who may have engaged in such activity near a trail where the fire began.

Some 30,500 people, about a third of Santa Barbara's population, was under mandatory evacuation orders at the height of the fire threat on Friday.

According to latest estimates, the so-called Jesusita blaze, the fourth major wildfire to strike Santa Barbara in two years, has destroyed 77 homes and damaged 22 others. Authorities said 500 homes were threatened.

No civilian casualties have been reported since the blaze began last Tuesday but 18 firefighters were hurt, including three who suffered severe burns and smoke inhalation when they were overrun by flames, fire officials said.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.