Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Jan. 13, 2018, 1:51 AM UTC / Updated Jan. 13, 2018, 1:51 AM UTC / Source : Associated Press

VENTURA, Calif. — The largest wildfire on record in California was declared contained on Friday, days after mud on the coastal mountain slopes it scorched crashed down on homes during a storm, killing at least 18 people.

The Thomas fire was declared 100 percent surrounded after ravaging Ventura and Santa Barbara counties northwest of Los Angeles for more than a month. A cause has not yet been determined.

Some areas of Los Padres National Forest remain closed to the public until authorities determine it is safe to enter.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The blaze began on Dec. 4 and fierce winds drove the flames through tinder-dry brush, chaparral and trees. The fire blackened 440 square miles — an area nearly as large as Los Angeles.

Flames whipped through foothill communities and forest wilderness. More than 1,000 buildings, including many homes, were incinerated and thousands of people were forced to flee.

Evacuations were called for Montecito as flames topped ridges above the wealthy enclave that was hit by waves of mud on Tuesday.

Photos: California battles massive Thomas Fire

Two people were killed in the fire. Cory Iverson, a 32-year-old state firefighter, died of burns and smoke inhalation while working in steep country above Fillmore.

A preliminary state fire report said Iverson was laying hose line near a firebreak cut by bulldozers when he became surrounded by spot fires that exploded around him and cut off his retreat.

Four other members of his team managed to escape.

A firefighting helicopter drops water as efforts to battle the Thomas Fire were under way on December 9, 2017 in Ojai, California. John Cetrino / EPA file

Some Montecito families had only recently returned home when another evacuation call went out on Monday.

Forecasters warned that the approaching storm could unleash flooding and mudslides because fire-scorched areas had lost vegetation that stabilizes soil.

Cascades of mud, boulders, trees and other debris inundated the community, destroying at least 100 homes.