California Sen. Kamala Harris, a Democratic presidential candidate, once sided against a Sikh man who was barred from a job as a prison guard because he refused to shave the beard his religious faith requires him to keep.

California’s Department of Corrections and Rehabilitation required prison guards to be clean shaven, in order to ensure gas masks fit properly, but allowed prison guards with medical conditions that prevent them from shaving to grow beards up to one inch long. Prison guards whose religious beliefs forbid them from shaving received no such exemption.

Trilochan Oberoi, the former prison guard, sued the state agency in 2007, alleging religious discrimination. An arbitration board ruled in his favor in October 2008, ruling that the state “made no efforts to accommodate him at all.”

But the state opted to continue fighting the case in court.

Harris continued litigating Oberoi’s case after she took over as attorney general in January 2011, which angered a broad swath of civil rights groups.

A coalition of groups including the Anti-Defamation League, American-Arab Anti-Discrimination Committee, Center for Constitutional Rights, Japanese American Citizens League and Sikh Coalition sharply criticized Harris in a letter to former Democratic Gov. Jerry Brown.

The civil rights groups complained that more than two years after the arbitration ruling, Harris’s office was “using California taxpayer dollars to vigorously oppose the right of Mr. Oberoi to work as a state corrections officer, thus jeopardizing the civil rights of Sikhs, Muslims, Jews, and indeed all others who still face the ignominy of having to choose between religious freedom and a job.”

“We find the California Attorney General’s adversarial posture in this case to be demeaning to religious minorities and utterly inconsistent with your own obligation to defend civil rights for all Californians,” the civil rights groups said. (RELATED: Kamala Harris Pressures Catholic Nominee Over Knights Of Columbus Membership)

The state settled with Obeori in October 2011, agreeing to pay him $295,000 in damages and giving him a manager position in the corrections department, but leaving the policy in place.

“What I take away from that is [Harris] will only do the right thing when there is political scrutiny from her allies on it,” Oberoi’s lawyer, Harmeet Dhillon, told The Daily Caller News Foundation in a phone interview.

Harris’s presidential campaign did not return an email seeking comment.

“All of the same facts were there throughout those four years. None of the facts changed,” added Dhillon, who now also sits on the Republican National Committee.

“The case law didn’t change, the facts didn’t change, only the political circumstances changed, and that’s what finally led to the case resolving and my client being hired by the CDCR,” she added.

Follow Hasson on Twitter @PeterJHasson

Content created by The Daily Caller News Foundation is available without charge to any eligible news publisher that can provide a large audience. For licensing opportunities of our original content, please contact licensing@dailycallernewsfoundation.org.