MARTINEZ — In a tense hearing Friday morning, a Contra Costa County Superior Court judge said he would impose sanctions against the state’s Department of Developmental Services if a murder defendant isn’t moved to a mental institution promptly.

It is the latest development in the years-old prosecution of Marc Carr, 29, who is accused of two murders, an attempted murder, and kidnapping and assaulting a jail guard. Carr suffers from multiple mental disabilities and in July, a judge found him incompetent to stand trial.

But in the months since then, Carr’s attorney says the Department of Developmental Services has been “very resistant” to placing Carr in a mental institution so that doctor’s can attempt to restore Carr’s mental competency.

The Department of Developmental Services, meanwhile, contends that the Contra Costa County sheriff failed to turn over documents on Carr that the Department of Developmental Services needs to complete a report that’s mandatory when an inmate is moved to one of its facilities.

But on Friday, Judge Lewis Davis found the sheriff’s office had turned over the necessary documents, and demanded that Carr’s admission “carry on forthwith.” He said that if Carr isn’t placed within 30 days, “I will impose sanctions” against the Department of Developmental Services.

It was a hearing that grew contentious at times, with Davis at one point asking a Department of Developmental Services attorney, incredulously, if it would be legal for mentally ill jail inmates to die awaiting transfer to a hospital. Davis later rebuked the attorney, Carolyn Tsai, for remarking she did not want to engage in “little catfights” with Carr’s lawyer, deputy public defender Stephanie Regular.

Carr’s case has been tied up with legal questions about his mental health since his February 2015 arrest, when police say he broke into a home on Buttercup Place in Hercules, strangled resident Leroy Sandoval and tried to rape Sandoval’s girlfriend. Months later, county prosecutors charged Carr with a second murder count in the killing of Lynn Martin, a San Pablo woman who was killed in her home days before Sandoval.

In July, Judge Charles “Ben” Burch found Carr mentally incompetent to stand trial, after five months of testimony about Carr’s mental illnesses and poor upbringing. Carr was diagnosed with schizophrenia and intellectual disability.

Carr was ordered to be transferred to a mental facility and the Department of Developmental Services took on the case. Tsai told Davis on Friday that the holdup had to do with the department’s position that the sheriff had not turned over all the records on Carr.

“We want Mr. Carr to be placed as quickly as possible,” she said, adding that she found it bizarre the sheriff’s records did not account for a medical checkup that was mandatory for all jail inmates. “If he was truly getting so little medical care, you’d think the public defender would be asking why they were neglecting her client.”

Regular, meanwhile, said the sheriff had turned over all relevant records and that Carr hadn’t been receiving mental health treatment for years. She suggested the Department of Developmental Services was using the issue as an excuse to stall out the process.

“I’ve never seen such a roadblock put up for any client of mine,” she said.

Davis said it was reasonable for the Department of Developmental Services to think the sheriff didn’t turn over all the records, but said after reviewing what they had sent, he was confident it was everything.

Davis’ order allows for Carr to be placed in a facility run by the state Department of State Hospitals, which has its own issues with lengthy wait times for jail inmates found incompetent to stand trial. Contra Costa County judges have sanctioned the department multiple times over inmates awaiting transfers for longer than 60 days, in violation of a court order.