Massachusetts prisoners have been in an unprecedented lockdown for six weeks in the state’s 16 prison facilities in efforts to slow the spread of COVID-19, prompting concerns among advocates and some state officials about whether the practice is posing a new slew of health threats.

The state Department of Correction placed the entire system on lockdown in early April to quell the coronavirus outbreak — mostly keeping prisoners in their cells or dorms for 23 hours a day — with no end of the stringent policy in sight.

Prison advocates and their families say the practice is increasingly placing stress on prisoners, many of whom are panicked about getting sick, struggling with the lack of information and suffering increasing mental health issues, including suicidality.

“People are calling our office increasingly very desperate to get out of their cells, deteriorating mental health-wise,’’ said Elizabeth Matos, executive director of the Boston-based nonprofit, Prisoners' Legal Services. “There needs to be a plan to end the lockdown.”

State officials say this is the first time in recent memory that the state prisons have locked down the entire system because of a health problem. The longest recorded lockdown at one facility occurred in 1995 at the Massachusetts Correctional Institution — Cedar Junction in South Walpole following an assault on a correction officer, according to court records.

Concerns about the lockdown came up during a remote hearing held last week by the state Supreme Judicial Court related to a lawsuit filed by Prisoners’ Legal Services. The suit aims to reduce the population of prisoners in state prisons and county jails to allow for social distancing. A decision is expected soon.

During the hearing, Supreme Judicial Court Justice David Lowy said the lockdown poses, “mental health issues, physical issues and basic decency issues,” and asked the DOC whether restrictions could pose their own constitutional rights violations.

DOC attorney Stephen Dietrick responded that correction officials are monitoring the situation but need to balance conditions with keeping prisoners safe from a highly contagious disease.

Trust me when I tell you, nobody thinks this is an ideal situation,’’ he said. “It's a necessary one.”

On Monday, the DOC implemented a “fresh air” initiative where prisoners can get outside a few hours a week, state officials said.

Despite measures, the coronavirus has spread into seven of the state’s 16 prisons and eight of the 13 county jails, according to the latest data collected by the American Civil Liberties Union of Massachusetts.

The Department of Correction announced Thursday that an eighth inmate died this week of COVID-related cases. Currently, 511 prisoners have tested positive within the state’s prisons and jails, according to the ACLU data, and there have been some 795 pre-trial and sentenced prisoners released related to efforts to depopulate the system.

Matos said state officials need to do more to reduce numbers. She says the lockdown is not the right answer, comparing conditions to solitary confinement, which she says can cause permanent psychological damage.

She joined other mental health advocates to send aletter in late April to Gov. Charlie Baker, urging him to ease up the restrictions.

“The lockdown threatens prisoners’ lives,’’ advocates wrote in the missive signed by members of Disability Law Center, the Center for Public Representation and the Mental Health Legal Advisors Committee, among others.

As part of the lockdown, prisoners also are required to eat in their cells or dorms, prompting complaints about unhealthy food, including lots of white bread and baloney sandwiches.

Concerns about the food at the North Central Correctional Institution in Gardner led to a food strike last week, according to members of an advocacy group Deeper than Water. They said about 40 inmates refused to accept their food trays as part of protest demanding healthier food and fresh air.

Two prisoners who helped organize the protest have since been put into segregation, they said. DOC officials said they are investigating what happened at the prison.

Jessica Kant, an organizer with Deeper than Water, said she is worried about psychological effects of the lockdown on prisoners over time.

“Thinking about the mental health ramifications downstream is really terrifying,’’ she said. “I don’t think the DOC is prepared to handle that.”