The Massachusetts Supreme Judicial Court on Tuesday denied an emergency effort to immediately reduce the state prison population to quell the risks of COVID-19, ruling advocates likely couldn’t prove that inmates’ constitutional rights were being violated.

The state’s top court instead sent the case back to the Suffolk Superior Court to examine the case as an “emergency matter.” It also directed the court to consider specific concerns about people incarcerated because of substance abuse issues, arguing that the risks of getting coronavirus may outweigh benefits of limited treatment available under a facilities-wide lockdown.

The 77-pageruling came in response to lawsuit filed in April by the nonprofit Prisoners’ Legal Services, concerned about the coronavirus outbreak in the state’s prisons and jails. More than 600 prisoners in the state’s penal system have tested positive for COVID-19, according to data released to the American Civil Liberties Union of Massachusetts. Eight state prisoners have died from the disease.

The decision was welcome by state officials. The state Department of Correction says it has tested more than 7,600 prisoners, some of them more than one time. The Parole Board has issued more than 560 release permits since April 3, the state said.

"The administration is pleased that today’s decision appropriately reflects the unprecedented steps that Massachusetts’ criminal justice agencies have taken to support the health and safety of the people in our care, our vendors, and staff,’’ said Jake Wark, director of communications for the Executive Office of Public Safety and Security. “We remain committed to adopting effective strategies that protect the public at large while safely managing our facilities.”

On the other side, Elizabeth Matos, head of the Boston-based advocacy nonprofit, said she was disappointed about the court decision. She’s concerned not only about the spreading virus but the prison lockdown, which she says is also creating a mental health crisis.

“Without releases, the dangerous conditions we are seeing now will only escalate,” she said.

The good news, she said, is that the court justices did acknowledge the public health risks to inmates both to the virus and prison conditions. Judges said “it is undisputed” that the situation in the system “is urgent and unprecedented, and that a reduction in the number of people who are held in custody is necessary.”