A Hennepin County district judge ordered Minnesota’s top mental-health official to testify Monday on why state psychiatric hospitals are refusing to admit three men who have diagnoses of severe mental illnesses, instead leaving them to languish in Hennepin County jail.

The hearing also surfaced ongoing tension between the state Department of Human Services (DHS) and the Hennepin County Sheriff.

Last week, Judge Elizabeth Cutter ruled that the three men must be committed to treatment facilities operated by DHS. Minnesota law requires the state admit them within 48 hours of a judge’s commitment order for prompt treatment.

On Monday morning, when DHS had still failed to take them, Cutter called Commissioner Emily Piper into an emergency hearing to explain why.

In court, Piper testified that the state has run out of room in the facilities that would normally take these patients — and they already are over capacity from what’s considered safe for other patients and staff.

“We are trying as hard as we can to accept the highest number of patients we can every day,” Piper told the judge. “It’s not for lack of trying.”

Piper attributed the problem to an increase in commitments from jails. In 2014, judges ordered 113 of commitments of patients that must be transferred in 48 hours, according to DHS data.

Last year that number hit 167. As of June 5, there have been 86, with seven more pending, the data show.

Cutter gave DHS a week to submit a memo to the court with further explanation, but said she didn’t want to give the court’s stamp of approval to a failure on the part of DHS to comply with state law.

Attorneys for the patients testified their clients are likely to get worse if they stay in jail; one said her client was suffering from delusions and didn’t know he was in jail.

“The bottom line is, there are three individuals who have been court ordered to treatment … and they are in a correctional facility and they are likely to [mentally deteriorate],” Cutter said.

Cutter ordered DHS to provide updates every 24 hours on the patients.

Last Wednesday, after DHS officials said they had no room for another patient, county deputies ignored them and dropped a patient off anyway.

Deputies attempted to transport three more patients on Saturday and Sunday, each of whom had been jailed longer than the 48-hour time limit, but were turned away, and records show they are back in jail.

Sheriff Rich Stanek, who has been outspoken for years on the perils of warehousing mentally ill people in jails, said the Hennepin County Public Safety Facility has also been operating over capacity recently.

But beyond jail space, he said he has no legal authority to hold offenders after a judge has ordered them into mental health treatment.

“It’s a judge’s order,” said Stanek. “It’s my job as a county sheriff to enforce the orders of the court. Not deny them. Not work around them. Not ignore them. Which is why I did not.”

Piper told the court it was “the first time I’ve ever had a sheriff forcibly admit a patient.”

In an interview afterward, Piper said she called Stanek last week and “expressed my concern” over deputies ignoring DHS staff and transporting the patients.

“One thing is certain: I can’t have the same challenges happening over and over where 87 counties have 87 sheriffs dropping people off and leaving them at our hospitals over our objections,” she said. “And Sheriff Stanek knows that.”