(AFP) — The deadliest and most destructive fire in California’s history was finally brought totally under control by firefighters, more than two weeks after it erupted, authorities said on Sunday.

“#CampFire … is now 100% contained,” Cal Fire, the state fire authority, said in its latest bulletin on Twitter.

The fire, which broke out on November 8, is so far known to have killed 87 people although another 249 people remain unaccounted for. That figure has fallen sharply over the weekend, having stood at 474 on Friday.

Only 54 of the fatalities have been identified, according to the local sheriff’s office in Butte County, around three hours drive north of San Francisco.

A total of 153,336 acres were affected by the fire, with nearly 14,000 homes and hundreds of other structures destroyed.

Heavy downfalls that have soaked the firezone in the past days helped douse the remaining flames, but also made it more difficult for crews searching for bodies.

The Camp Fire was the second major blaze to hit California in recent weeks with a fire in the Malibu area near Los Angeles also killing three people.

The smoke from the Camp Fire was so intense that schools in San Francisco had to close at one point earlier this month as did the city’s famed cable car and Alcatraz Island.

California’s governor, Jerry Brown, has warned that the state can expect a growing number of major fires as a result of global warming.

US President Donald Trump, who visited one of the worst-hit towns called Paradise last weekend, caused some consternation by saying that the fires were due in part to forestry mismanagement.

Ahead of the announcement that the fire has been totally tamed, authorities had already begun letting residents return to some of the worst hit areas to inspect the damage to their homes.

In a joint bulletin posted on Saturday, the police and fire service said evacuation orders that had in place for some areas over the last fortnight were being lifted for both residents and non-residents, while warning that essential services were still “very limited”.

“Prior to returning home, residents are encouraged to take steps to ensure they have food, water and fuel for their vehicles,” said the statement.

While Brown has warned that mega fires such as those in Butte and Malibu will cease to be “abnormal” events, the state has allocated about $1 billion over the next five years for fire prevention.

Much of the cash will go on education and suppression activities such as clearing grasses and other vegetation, according to officials.

But many experts are calling for more restrictions on housing being built in forests as a means of eliminating danger before the blazes even break out.

A recent study found that one third of all US houses now are located in what researchers refer to as the wildland-urban interface, where houses and forest vegetation intermingle.

While Trump has repeatedly expressed skepticism about global warming, a new report by his administration warned Friday that climate change will cost the US hundreds of billions of dollars annually by century’s end unless drastic action is taken to cut carbon emissions.

A burnt car at a gas station on November 11, 2018 after the “Camp” fire tore through the region near Pulga, east of Paradise, California

A home is overshadowed by towering smoke plumes on November 8, 2018 as the Camp fire races through town in Paradise, California

Firefighters battle flames at a burning apartment complex in Paradise, California on November 9, 2018