SANTA BARBARA — The deadly wildfire that has ravaged Southern California for nearly two weeks gained fury overnight and now threatens swaths of coastal Santa Barbara County, authorities said Saturday.

Heavy winds, dry brush and low humidity keep fueling the Thomas Fire, said Jude Olivas, a public information officer and Newport Beach firefighter who was monitoring the destruction. Smoke clouded the sky, forcing water-dumping helicopters to stay grounded through the afternoon.

“There’s very, very poor visibility in those areas,” Olivas said of Montecito and Summerland, where emergency vehicles were parked at the ready outside churches and public schools. “We’ve got over 400 firetrucks out there.”

Aerial photos showed the blaze to be about 40 percent contained Saturday, he said. But the risk remains high for people living near the foothills of Montecito — home to a number of celebrities, including Oprah Winfrey and Ellen DeGeneres.

Joe Rosa, another firefighter in the area, said erratic winds kicked up the flames and pushed crews to temporarily retreat.

“It wasn’t a safe spot,” Rosa said of the front lines. “They pulled them out. Our number one goal is life safety.”

The mandatory evacuation zone Saturday afternoon stretched 17 miles long and about 5 miles wide, running from the mountains northwest of Los Angeles to the Pacific Ocean. Rain isn’t expected to quench the area for another 10 days. Winds in the foothills reached 30 mph, with gusts hitting twice that speed.

By 2 p.m., firefighters said they didn’t know whether flames had charred any homes in the area, asserting they’d inspect neighborhoods once the blaze had cleared.

Melissa Baffa, 43, worried about her workplace, which sits near the evacuation perimeter.

The inferno missed her house last week in the Ojai Valley, just east of Santa Barbara — although it covered her lawn with ash — and she hoped the Santa Barbara Museum of Natural History would survive, too.

Inside are thousands of artifacts and bones, including an ancient mammoth skull.

“It’s like a war zone here, with all the firetrucks and first responders,” said Baffa, one of the museum’s grant writers. “It has now moved from where I live to where I work.”

As people fled Santa Barbara County, some shared their thoughts and views on Twitter:

The fire has scorched roughly 259,000 acres and 700 homes in Southern California since it started Dec. 4. The cost of battling the blaze has exceeded $104 million, officials said, as more than 8,000 firefighters work to suppress it.

One firefighter died Thursday trying to halt the blaze.

Cory Iverson, 32, had worked with Cal Fire for eight years, serving as an engineer for the San Diego unit. He was also the father of a 2-year-old daughter, and his wife, Ashley, is pregnant, according to the California governor’s office.

Across the city of Santa Barbara on Saturday, residents began preparing for the worst.

“We got the alert when I woke up this morning,” said Camron Kazerounian, 26. “The smoke looks crazy right now. You can see the dark plumes right over the hills.”

Like many locals, Kazerounian is fleeing the city for safer ground. He said he was heading back to his parents’ home in the Bay Area.

“I don’t have any respiratory issues normally, but you can start to feel the slight burn in the back of your throat,” he said. “It’s been a week and half now that it’s been smoky. You can smell the smoke and feel it.”

Shane Kleinebecker, who had just returned to the city after a short evacuation to Bakersfield, said he had no choice but to pack up again.

“The street that’s under mandatory evacuation is visible from our front yard,” the 33-year-old said.

State Street, normally a bustling center of life and commerce in downtown Santa Barbara, was eerily quiet Saturday as the Thomas Fire raged closer. Many shops and restaurants were closed, and the street was nearly empty of pedestrians.

Joe’s Café, long a popular hangout in Santa Barbara, also shuttered early.

“Next year will be our 90th year,” said Deborah Bahre, 58, the assistant manager. “We consider ourselves an institution, so for us to close is a big deal.”

Patrons have been leaving extra money to cover the firefighters’ meals, she said.

“All day long we’ve had firefighters,” she said, and not one has paid a bill since the fire started.