Thousands of prison inmates are helping to battle the infernos raging across California.

Around 3,900 prisoners are enrolled in the program, including 200 women. They get extra time off their sentences and earn $2 a day and $1 for each hour of active duty.

They join 8,000 firefighters, hundreds of fire engines and dozens of aircraft deployed to combat the numerous blazes that have already incinerated more than 200,000 acres and killed at least 31 people so far, as well as leaving hundreds missing.

“This is an all hands on deck effort”, California Governor’s Office of Emergency Services Director Mark Ghilarducci said.

Some assistance has come from neighbouring states; some has come from the federal government. And some help has come from within the walls of California’s correctional system, where a program allows inmates who pose a minimal security risk to venture outside of prison walls and into fire camps.

California Department of Corrections and Rehabilitation spokesman Bill Sessa praised the inmates, calling them “the highest paid prison job there is” – though he said the primary benefits aren't monetary.

“The environment in camp is a lot different from an institutional setting behind an electric fence. It’s more informal, it’s a more relaxed environment”, Mr Sessa said, and “they leave with a lot of good life skills that will help them succeed whenever they choose to leave prison”.

Mansions burn in California wildfires Show all 7 1 /7 Mansions burn in California wildfires Mansions burn in California wildfires The local fire department has deployed up to five helicopters and six aircraft to drop water on the fire Getty Images Mansions burn in California wildfires Local residents watch as homes are threatened by the fire MARK RALSTON/AFP/Getty Images Mansions burn in California wildfires A helicopter dumps water onto flames on the hillside as houses burn MARK RALSTON/AFP/Getty Images Mansions burn in California wildfires Local residents Steve Wells (L) and Scott Douglas (R) pack their cars after police issued a mandatory evacuation order MARK RALSTON/AFP/Getty Images Mansions burn in California wildfires Santa Barbara County Fire officials said around 2,000 people were ordered to evacuate AFP Mark Ralston Mansions burn in California wildfires The wind-driven wildfire destroyed homes and forced hundreds of residents to flee in the California coastal town MARK RALSTON/AFP/Getty Images Mansions burn in California wildfires A large smoke cloud shrouds the sky as residents evacuate during the Jesusita Fire MARK RALSTON/AFP/Getty Images

On Friday morning, some 1,700 of those inmates were joining the frontline effort to quell flames that have already consumed huge swathes of California, claiming over 2,800 homes in the city of Santa Rosa alone.

Working in crews of about a dozen, inmates are trained to halt the spread of fires by cutting firebreaks, or gaps in the vegetation that fuels wildfires. Fire officials have warned that the current blazes are feeding on a tinderbox of excessively dry brush – the legacy of a half-decade of drought that only just ended – with California Department of Forestry and Fire Protection chief Ken Pimlott warning of “explosive vegetation”.

Since high winds helped ignite and spread the fires on Sunday night, there has been little respite for thousands of evacuees or for firefighters toiling to protect lives and homes – including inmates.

“When that firestorm blew up so quickly we had some crews that worked 72 straight hours, catching as little sleep as they could, sleeping on the ground”, Mr Sessa said.

“All of these people are firefighters before they are inmates, and they are out there doing as heroic a job as all 8,000 of these guys”, he added. “They have already gone beyond what most of us have to give and they're still going”.

It seems likely they will still be going through the weekend, with officials warning that dry weather and swift winds will continue to feed fires. Firefighters have so far contained only about a quarter of the two powerful blazes that have spread across Sonoma and Napa County, the heart of California’s wine industry.

Deadly fires rage across California

The Napa Valley town of Calistoga faced one of the biggest threats, and its 5,000-plus residents were ordered to leave their homes as winds picked up and fires crept closer.

Calistoga Mayor Chris Canning said anyone refusing to heed the mandatory evacuation would be left to fend for themselves if fire approached, warning on Thursday: “You are on your own.”

Sonoma County accounts for 17 of the North Bay fatalities, all from the Tubbs fire, which now ranks as California's deadliest single wildfire since 2003.

Some people killed were asleep when flames engulfed their homes, fire officials said. Others had only minutes to escape as winds fanned fast-moving blazes.

As many as 900 missing-person reports have been filed in Sonoma County and 437 people have since turned up safe. It remains unclear how many of the 463 still unaccounted for are fire victims rather than evacuees who failed to alert authorities, Mr Ghilarducci said.