California's fire season is well under way with 14 different blazes, driven by an ongoing drought, burning across the state.

But an unexpected group is on the front lines of firefighting efforts — thousands of California state prisoners.

Nearly 4,000 male inmates are currently battling wildfires across the state, according to California Department of Corrections and Rehabilitation (CDCR). That means they make up about 40% of the nearly 10,000 firefighters deployed to the wildfires statewide.

They work some of the most harrowing jobs in the firefighting operations — like clearing brush to stop the spread of fires — and assist state and local fire crews.

The crews are trained by Cal Fire, the state agency that coordinates firefighting efforts. Some use their training to find jobs as firefighters once they are released from prison, says CDCR.

#DidYouKnow? Nearly half of the people fighting CA fires with CAL FIRE are #CDCR inmates: http://t.co/IL8TaNiBRm . @FOX40 — CA Corrections (@CACorrections) August 14, 2015

“It’s a challenge out there fighting aggressive fires,” inmate firefighter Tyrell Long recently told local news outlet Fox 40. “It shows you how to work and be a better person, and it's structure.”

The crews on the frontline are made up of non-violent inmates incarcerated for low-level felonies. They are led by a fire captain, and unlike the prisons where they are coming from, there are no guards out on the front lines. Despite that, escape attempts are uncommon, according to officials.

"This is a reward for many of these individuals," Daniel Berlant, a spokesman for Cal Fire, told Mother Jones. "They're outside the walls, doing good work, learning a skill that they may not get behind bars. They don't want to screw up."

Bill Sessa, spokesman for the CDCR told Fox 40 that the use of inmates saves the state of California about $100 million a year in firefighting costs.

Prisoners are given a four-week training course to ensure they're able to work in the heat of a fire while carrying up to 100 pounds of gear. The team of around a dozen inmates is overseen by a fire captain, and the inmates work in 24-hour shifts.

Footage released by CDCR shows a group of inmates receiving training at the beginning of the 2015 firefighting season.

The program is nothing new — Cal Fire has relied on state inmates for decades.

But Sessa says Cal Fire may soon need to rely more on county jail inmates in the coming years due to a shrinking population in state prisons. Nevertheless, the program has still remained a vital part of the firefighting force.

"All of the predictions up to now of having a reduced prison inmate population to work the fires have kind of fallen through – because even though we have fewer inmates than we used to have, we still have enough,” Sessa told Capital Public Radio.

While the program is entirely voluntary, the work is undoubtedly dangerous. Those who take part make just $2 per day in the program and $2 per hour on the frontline.

Each day of firefighting also earns the men a two-day sentence reduction.