Image copyright Google Maps Image caption The Nowata County Sheriff's Office is now operating on a skeleton staff after a slew of resignations

An Oklahoma sheriff and all of her deputies have quit in protest of dangerous - possibly lethal - conditions at an old rural county jail.

Nowata County Sheriff Terry Barnett said the dilapidated jail had near-toxic carbon monoxide and mould levels and no fire alarms, among other issues.

Prisoners have been housed in another jail since the end of February due to these safety concerns.

The officers quit after a judge ordered them to return prisoners to the jail.

At a news conference on Monday, Ms Barnett announced that she, along with her undersheriff, deputies, head dispatcher and the majority of the jail staff, were resigning over the "inexcusable" conditions.

The rural jail's carbon monoxide levels were just two points away from lethal and four employees had been taken to hospital as a result, she said. The jail has been closed since that incident.

Other problems at the facility include exposed wiring with outlets that have shocked inmates, no surveillance cameras, faulty sewage lines with methane leaks, inadequate staffing and even "an episode of a snake falling on the head of a prisoner when opening a door".

An audit from the American Correctional Association had listed out all of the facility's issues in a 69-page report earlier this month, local media reported.

But Judge Carl Gibson said he would hold Ms Barnett in contempt of court if she would not re-open the jail.

"I cannot do so in good conscience," Ms Barnett told reporters. "I believe in doing the right thing."

The sheriff, who took office in November, also alleged the judge suggested he could raise her salary during a meeting where he tried to convince her to re-open the facility.

The judge has declined to comment on the allegations, local media say.

"Under no circumstances will I shove anything under the carpet concerning Nowata County," Ms Barnett said.

"I see without support it is only continuing to create a dangerous situation. Instead of looking for solutions many would continue to hope and pray that nothing would happen.

"I too hope and pray that nothing happens, that our prisoners remain safe wherever they are, and that our employees remain safe."

Image copyright US Deputy Sheriff's Association/Facebook Image caption Nowata Sheriff Terry Sue Barnett and Deputy Justin Melton

On Wednesday, the county appointed an interim sheriff, the Tulsa World newspaper reported.

At least five sheriffs have previously resigned from Ms Barnett's role since 2015, according to the newspaper.

Ms Barnett replaced the incumbent sheriff, who had been charged with embezzlement for allegedly using donated school supplies to promote his own election campaign.

Reaction to Ms Barnett's resignation has been mostly positive, with many on social media calling the officers true role models for following their ethical beliefs and protecting the safety of all residents.