An atheist in Northern California has been awarded nearly $2 million in a settlement with the state and a nonprofit drug rehab organization for violating his religious liberty by sending him to jail for refusing to submit to a “higher power” as part of a treatment program, local news outlets reported.

After serving a year behind bars for methamphetamine possession, 46-year-old Barry Hazle Jr. of Shasta County was ordered to participate in a residential drug treatment program.

When he arrived at the Empire Recovery Center in Redding, Calif., he was told that the center’s 12-step program, which was modeled on Alcoholics Anonymous, involved submitting to a “higher power” through prayer, The San Francisco Chronicle reported on Tuesday.

Hazle, an atheist, balked and asked about secular drug rehab, but he was told that Empire was the only state-approved facility in Shasta County and that it wasn’t picky about who that higher power should be, the Chronicle said.

“They told me, ‘Anything can be your higher power. Fake it till you make it,’” he told the newspaper.

But when Hazle still objected — the program includes prayer and references to God, according to The Redding Record Searchlight — he was sent to jail at the California Rehabilitation Center in Norco for more than 100 days. Probation officials said they did so because he was being “disruptive, though in a congenial way, to the staff as well as other students ... sort of passive-aggressive,” the Record Searchlight said.

In 2007, Hazle sued the California Department of Corrections and Rehabilitation (CDCR) and WestCare California, a Fresno-based substance abuse treatment organization contracted by the CDCR to coordinate rehab for parolees, according to The Sacramento Bee.

Six weeks later, the CDCR, citing federal case law, issued a directive saying that parole agents can’t compel a parolee to participate in religious-oriented programs and that they must offer a nonreligious alternative if they object, the Bee reported.

A U.S. district court judge ruled in 2010 that that Hazle’s constitutional right to religious freedom had been violated, but the jury declined to award damages, the Chronicle said. The 9th Circuit Court of Appeals ruled in 2013 that he was entitled to compensation and ordered a retrial, and on Tuesday he and his lawyers announced a $1.95 million settlement, which he will receive from the state and WestCare California, the newspaper said.

“I’m thrilled to finally have this case settled,” Hazle told the Record Searchlight. “It sends a clear message to people in a position of authority, like my parole agent, for example, that they not mandate religious programming for their parolees and for anyone else, for that matter.”