A federal lawsuit in Virginia is threatening to upend the state’s practice of automatically placing death row inmates in near constant solitary confinement, and experts say it could spark similar challenges across the country to a prison practice that is increasingly being scrutinized.

A U.S. District judge in April rejected Virginia officials’ bid to have the case thrown out in its early stages, noting that while other courts had ruled that such confinement for death row prisoners was constitutional, the time might be right for a reassessment. U.S. District Judge Leonie M. Brinkema said the issue needed to “be looked at in the context of evolving and changing moral and legal standards,” and she urged state officials to “give some serious thought to trying to work this case out.”

“I do not understand why the commonwealth is insisting on maintaining this level of these conditions,” Brinkema said. “They really need to be thought about carefully.”

The lawsuit — and Brinkema’s comments — come at a time when long-term solitary confinement is facing increasing criticism across the country.

Advocates say that prisoners who are forced to spend nearly 23 hours a day isolated in small cells — as those in Virginia and elsewhere do — suffer severe mental distress and that the practice amounts to cruel and unusual punishment.

“The overwhelming consensus in the mental-health community, in the medical community, is that [it] is extraordinarily unhealthy,” said Robert Dunham, executive director of the Death Penalty Information Center. “In the vernacular, solitary will drive you crazy.”

The problem is particularly pronounced for death row inmates, who often spend a decade or more in prison before they are executed, have their sentences changed or, for some, are exonerated. A federal judge in California last year ruled the state’s death penalty unconstitutional because of the long time that death row inmates must wait before they are executed, if they are executed at all.

Brian Stull, an attorney with the American Civil Liberties Union who specializes in capital punishment issues, said that long-term isolation is particularly problematic on death row because solitary confinement is “not part of the punishment.”

“It feels like a sentence of torture before execution,” Stull said.

Virginia officials have said the practice is necessary to ensure prison safety and noted previously that in the 1980s, death row inmates who were not isolated organized an escape.

To be sure, the four death row inmates in Virginia who are suing were convicted of heinous crimes. (The lawsuit was initially brought by five inmates, but one dropped out.) One of the four condemned men killed a police officer, another raped and killed a woman whom he attacked while she was sleeping, and the other two killed several people each, including children. Attorneys for the state deny that the inmates have suffered the harm they allege.

Although Brinkema indicated a willingness to hear more from both sides, the inmates may still face an uphill battle. The U.S. Court of Appeals for the 4th Circuit, for example, recently overturned a different ruling from Brinkema that declared unconstitutional Virginia’s practice of automatically placing death row inmates in solitary confinement. But the judge’s ruling in that case focused on whether the state’s procedure violated the inmates’ right to due process. Now, she must decide more directly whether placing inmates in solitary confinement while they await execution is cruel and unusual punishment.

Victor M. Glasberg, an attorney representing the four inmates in Virginia, said the lawsuit could spark a “significant change” if it were successful, although it probably would have to go through the appeals court and possibly to the U.S. Supreme Court. He said that while Brinkema’s comments were no guarantee of success, she was at least saying, “ ‘I need to learn about this.’ ”

“She’s telling the department, ‘Maybe you’ll win, but I need to see the facts. I need to learn what there is to be said about whether this is appropriate or not appropriate,’ ” Glasberg said.

Legal experts say many of the 31 states that still use capital punishment do hold death row inmates in some type of solitary confinement. Those jurisdictions include Texas and Louisiana, as well as the federal prison system, although conditions of confinement vary. Even attorneys for the four in Virginia acknowledge that the practice has — in the past — been determined to be constitutional.

A spokesman for the Virginia attorney general’s office referred questions to the state Department of Corrections, and a spokeswoman for that agency declined to comment for this article, citing the pending litigation. In court filings, state lawyers have cited other cases to argue that “comfortable prisons” are not mandated by the Constitution.

“More specifically, with regard to solitary confinement, the Fourth Circuit has made it clear that confinement in segregation in and of itself does not amount to cruel and unusual punishment, even if for a prolonged period,” state lawyers wrote.

Civil liberties lawyers and others counter that automatic solitary confinement for those on death row is costly to taxpayers — as it is more expensive to house particular inmates away from the general prison population — and is ineffective. They say inmates should be screened individually to determine whether they pose security risks that warrant isolation, not simply made to live in isolation because they have been sentenced to death.

“There’s increasing recognition of how damaging it is, how unnecessary it is, how it does not increase safety in prison,” Stull said. “There’s really no good reason for it.”

In another, ultimately unsuccessful challenge to Virginia’s practice of automatically placing death row inmates in solitary confinement, a group of nine former corrections officials submitted an amicus brief arguing that the practice was “harmful and unnecessary to institutional safety” and that there was a “growing recognition that long-term isolation is dangerous, counterproductive, and costly.”

They said that two U.S. Senate hearings were held to discuss the matter, that the Federal Bureau of Prisons had begun reviewing its policies, and that other states — including Missouri, North Carolina and Colorado — had abandoned automatic solitary confinement for those on death row.

Advocates note that some death row inmates are eventually exonerated, and sometimes, once released, suffer post-traumatic stress from their time behind bars.

“We don’t know what the courts are ultimately going to decide on this, but we do know more and more about the consequences of solitary confinement,” said Dunham, of the Death Penalty Information Center.

Glasberg said that while the crimes that death row inmates have committed are detestable, the punishment they face also is problematic. “I don’t think most people want people kept in solitary 23 hours a day, no matter how bad they are,” Glasberg said. He said he would view a victory in the case not just as a win for those in solitary confinement, but also as a benefit for the public.

“If this case succeeds in moving the system towards a more humane treatment of prisoners condemned to death, that’s huge,” he said. “It’s huge for them, and it’s huge for us as a society.”