A federal judge on Thursday denied a request to release medically vulnerable inmates at Chicago's Cook County jail but ordered officials to step up coronavirus testing for detainees and improve sanitation protocols. The facility is experiencing one of the largest outbreaks from a single location in the country.

Last week, attorneys for two detainees with pre-existing medical conditions filed a lawsuit in the U.S. District Court for the Northern District of Illinois. The suit names Cook County Sheriff Tom Dart as a defendant and demands improved conditions inside the facility, as well as the release or transfer of all medically vulnerable inmates.

In a 37-page opinion, Judge Matthew Kennelly found the plaintiffs did not go through all their legal options at the state level for the release of the inmates. Kennelly, however, ordered Dart to promptly test all inmates who display symptoms of the virus or have been exposed to someone who has tested positive.

Get Breaking News Delivered to Your Inbox

To reduce the risk of spread, the judge also ordered Dart to enforce social distancing for new inmates and suspend the use of bullpens, an area where inmates are kept in close confinement.

The sheriff's office said in a statement Thursday that "much of what the court is requiring today has been well underway for weeks and even months in some cases."

More than 400 confirmed cases of the virus have been linked to the jail. As of Thursday, 276 detainees and 172 sheriff's office staff have tested positive. One detainee died after contracting the virus.

"Sanitation in a jail is not a new problem," said Alexa Van Brunt, director of the MacArthur Justice Center's clinic at Northwestern University, one of the groups who filed the suit. "It's clear from anyone who spent time in there that the measures that currently exist are not going to be enough to protect people. Certainly not enough to comply with CDC guidance."

The sheriff's office's statement called the lawsuit "headline-seeking" adding that it's "an unnecessary and costly distraction in the middle of such a crisis for our frontline officers and medical staff, whose round-the-clock work is saving lives."

In response to the pandemic, an expedited bond review was implemented in Cook County last month. The process has put more than 1,500 cases before judges, according to the Cook County State's Attorney's Office. The sheriff's office said there's been a 22% decrease in its population since March 9. With close to 4,500 inmates currently, the facility is at an all-time low.

CBS News recently spoke to three staffers and two former inmates on the condition of anonymity out of fear of retaliation. They claimed tensions ran high after officials announced the first confirmed cases inside the facility and criticized the jail's initial response to the outbreak.

Last month, a 500-bed quarantine facility was built to house sick inmates. The sheriff's office has denied claims of inadequate cleaning and sanitation protocols in the past. In its statement on Thursday, the office said: "We appreciate that the Judge acknowledged the many unique and aggressive efforts that the office has undertaken to identify and help those who catch the virus and to limit its spread."

Sheriff Dart has until Monday, April 13 at 4 p.m. local time to present a report about how his office intends to comply with the order. A status hearing has been scheduled for next Tuesday via phone.

"This is a result of all of the people on the ground coming forward," added Van Brunt. "This is just a first step and we realize people are still at high risk inside the jail for illness and death and we're evaluating our next steps about what to do about that."