At an August hearing, Judge Lynn Leibovitz, shown in 2016, said some defendants had remained in the jail weeks after she had ordered them transferred to the hospital for evaluation. (Bill O'Leary/The Washington Post)

A D.C. Superior Court judge Thursday threatened to hold the District agency charged with overseeing mental-health services in contempt for failing to provide a defendant with a court-ordered psychological evaluation.

Judge Milton C. Lee called the hearing after a woman who was arrested and accused of simple assault with a knife was sent away after she showed up at the courthouse for the scheduled Oct. 17 evaluation.

Andrew Saindon, assistant attorney general for the District, explained that the psychologist who was supposed to see the woman had been “double-booked” that day and could not conduct the assessment.

“We can’t turn people away because we don’t have the staff. Not here. Not now,” Lee said. “This really is contempt. You ignored a court order.”

Saindon said the District's Department of Behavioral Health has decided to spend about $10,000 to contract out with local doctors who can conduct evaluations. Long-term, Saindon said the agency plans to focus on continuing to hire and retain "qualified candidates." The woman's evaluation was reset for Tuesday, and a follow-up hearing in the case is scheduled for Thursday.

The hearing comes after months of tensions between D.C. Superior Court judges and both the behavioral health agency and the D.C. jail over the city’s handling of defendants who may suffer from mental illness. The Department of Behavioral Health also oversees St. Elizabeths Hospital, the city’s public psychiatric hospital.

At an August hearing, Judge Lynn Leibovitz said some defendants had remained in the jail weeks after she had ordered them transferred to the hospital for evaluation. She said at one point, there were 14 people in D.C. jail awaiting to be admitted to the hospital, according to a court transcript.

“What are you going to do to systematically and institutionally put an end to the failures being effected upon mentally ill persons who are unable to speak for and represent themselves?” Leibovitz asked jail and behavioral health officials, according to the transcript.

At a follow-up hearing, jail officials said all 14 of those inmates had been admitted to St. Elizabeths.

District officials have said in court that they were adding bed space at St. Elizabeths. They also said doctors from the hospital would come to the jail to assess inmates so the defendants would not have to wait for room to open up at the hospital.

The District is not alone in challenges it faces in providing mental-health care for inmates.

Last month, a Baltimore judge held five Maryland officials in civil contempt of court for failing to increase the number of psychiatric hospital beds available for mentally ill criminal defendants. This week, the state appealed the contempt order, and state officials have said that even before the contempt order they had been working on expanding the number of psychiatric beds.

Laura Usher, the senior manager for criminal justice and advocacy at the National Alliance on Mental Illness, said there are similar problems across the country. When those with mental illness languish in jail, most of them do not get adequate treatment, she said.

“It is common for people to be held in jail because there aren’t alternatives for them,” she said. “It’s an unjust and inhumane situation all around.”

Such issues, judges have said, are unfair to defendants and potentially put the public at risk if defendants are released into the community without needed services.

Lawyers with the District’s Public Defender Service argued that defendants who have been determined to have a mental illness should immediately be moved out of the jail and placed in a medical treatment facility such as St. Elizabeths.

The behavioral health agency’s “failure to meet its obligation to provide adequate and timely treatment to defendants, and its refusal to comply with the law and court orders is indeed troubling,” Laura Hankins, general counsel for the Public Defender Service, said in a statement.

At Thursday’s hearing, Lee’s frustration was clear.

“This happens repeatedly,” the judge said. “The only entity that doesn’t seem to have the same concerns about this is the entity that should have the most concern, the Department of Behavioral Health.”

“If I’m confronted with this again, a price has to be paid,” Lee told the agency.