An Oklahoma sheriff and the majority of her staff quit after citing uninhabitable conditions in the county jail.

Nowata County Sheriff Terry Sue Barnett tendered her resignation on Monday after a judge mandated her to reopen the county jail after high levels of carbon monoxide sent four of her employees to the emergency room last month.

The conditions of the jail do not comply with "constitutional standards," Barnett said in her resignation letter, which was obtained by NBC News.

The sheriff said that Nowata District Judge Carl Gibson informed her last week that if she did not bring the more than a dozen inmates back to the Nowata County Jail, she would be held in contempt of court.

"I've said from the beginning that if I became sheriff, I would serve the citizens by standing up and doing the right things," Barnett, who was elected in November, said in a statement. "This is just wrong, and I wasn't going to put human beings in that jail until we knew what was going on.

Twelve members of the Nowata County Sheriff's Office staff, including deputies and civilian employees, resigned with Barnett on Monday. Even the K-9 officer, Ranger, quit and signed his resignation letter with a paw print, Barnett said.

The sheriff's office said five people currently remain on the staff with dispatchers sourcing 911 calls and delegating them to stations nearby.

The "tipping point" for the sheriff was the Feb. 28 incident in which the level of carbon monoxide in the Nowata County Jail came to 18. She said the standard lethal level is 20.

Barnett immediately evacuated her staff and the inmates from the county jail, which serves more than 10,000 people in the nearly 600 square-mile region. The source of the high levels of carbon monoxide is still unknown, she said.

In the resignation letter, Barnett also detailed other dangerous conditions in the "inadequately budgeted" jail, including exposed wires in the shower areas that have shocked inmates, mold throughout the jail and offices, and "improper" plumbing that often causes methane gas to permeate the jail.

Nowata County Sheriff Terry Sue Barnett. KJRH

The inmates were transferred to Washington County, where they remained as of Wednesday, according to the Nowata County Clerk.

Judge Gibson declared Barnett's resignation "void" on Tuesday, but the sheriff said that is not within his right.

"I do not work for the judge. The judge is an elected official. I am also an elected official," Barnett told reporters. "I do not believe we live in a country where we can be ordered to go to work when I have already tendered my resignation."

The sheriff was called into court on Tuesday, where Gibson questioned whether housing the inmates in a different county was putting Nowata County at financial risk.

"As most of these things go, it's all about money," Barnett's attorney, Paul DeMuro, told NBC News. "The jail is a huge source of revenue for the county, so the financial piece of this story is a very important one."

Nowata is the third poorest county in Oklahoma, with a total operating budget of less than $1 million, according to KJRH.

"The Nowata County Jail is a ticking time bomb of constitutional liability," DeMuro said in a statement. "If the county thinks it has budget problems now, it better wake up because somebody is going to die in that jail."