Deputy sheriffs guarding Stanislaus County jails made people safer across much of California when jailers beat the county in a lawsuit and won the right to carry guns off duty, they said in new court papers.

The county didn’t fight this time, and agreed to cover the jailers’ $50,882 lawyer bill plus $3,434 in court costs.

“The public surely benefits when trained, experienced peace officers carry concealed weapons while off duty,” reads a document justifying the award. Armed off-duty officers have a better chance at protecting “themselves and the public at large during lethal emergencies – surely an important right affecting the public interest,” the paper says.

The briefing notes that an off-duty officer shot and killed Dahir Adan at a Minnesota mall in September after Adan stabbed 10 people, and an off-duty San Joaquin County deputy sheriff shot and killed a masked gunman who confronted him in Stockton on Nov. 1. The briefing did not mention the off-duty state correctional officer who shot a man jabbing a knife toward people at Modesto’s Costco store on July 28; the man survived.

A judge in Modesto initially ruled against Stanislaus custodial deputies when their union, the Stanislaus County Deputy Sheriffs Association, sued in 2013; the deputies asked to pack heat off duty without paying fees and going through applications for concealed weapons permits. The deputies appealed to a higher court and prevailed in August.

The union’s attorney, Richard P. Fisher of Goyette & Associates, then asked that a judge have the county pay his fee and court costs. His firm spent 255 hours over two years on the case, he said, with no pay because the lawsuit wasn’t about money.

But the law lets a judge order that the losing party pay the winning side’s fees if the outcome benefits society, according to a “private attorney general theory.” The appellate ruling “vindicates the rights of correctional deputies across 32 counties – more than half of the (58) counties in California,” Fisher contended.

The ruling is expected to affect policies in those counties, where jail guards jump through extra hoops not required of other peace officers such as patrol deputies and state correctional officers. Deputy sheriffs in the 26 other counties move between assignments in jails and street patrol without distinction.

Stanislaus County’s budget lists 234 custodial deputies and sergeants and 124 patrol deputies and sergeants.

The matter ended when the county – without acknowledging “fault or liability” – agreed out of court to pay the request. Fisher dropped a demand for an additional $7,500 based on his belief that the county’s policy was “arbitrary and capricious.”

Stanislaus Superior Court Judge Timothy Salter approved the settlement Dec. 21.