Three inmates with mental illnesses filed a lawsuit against staff at the Bristol County Sheriff’s Office this week, alleging they were treated to “extremely harsh conditions” and denied services to help them.

The suit claims the three prisoners were placed into solitary confinement in small cells for long periods of time, putting them at serious risk of self-harm. It claims the jail relies on segregation — where inmates must stay for as much as 23 hours a day — to house inmates with mental illnesses rather than providing them needed treatment.

The complaint comes eight months after an investigation by the New England Center for Investigative Reporting revealed that the Bristol County jail accounted for nearly a quarter of all jail suicides in Massachusetts from 2006 to 2016 even though it houses just 13 percent of inmates.

NECIR also found that officials warned the sheriff’s office on two separate occasions that inmates were likely suicidal, but the men were left alone in their cells and killed themselves within days.

Sheriff Thomas M. Hodgson dismissed the lawsuit on Wednesday as “frivolous,’’ and full of “inaccuracies” and “out and out lies.” He said claimed plaintiffs were simply pushing their agenda as the state legislature considers reform in the criminal justice system.

He said an internal inspection into suicides at the jail found that most deaths were not caused by segregation, but instead had to so with something that occurred or someone outside of the facility.

“They are not experts, these are lawyers,” he said, basing the complaint on stories of inmates. “We are not going to base our policies on those reviews.”

Bonita Tenneriello, an attorney with the nonprofit Boston-based Prisoners’ Legal Services, said the suit follows years of complaints from prisoners about their treatment in the Bristol jail. Inmates can be segregated for months or even years, the suit said, with higher risk of suicide and self-harm.

She said mental health watch is so punitive — with troubled inmates left alone in cell in a tear-proof smock — that most prisoners avoid revealing suicidal thoughts.

“Putting people with behavioral problems in solitary confinement doesn’t teach them anything,’’ she said. “Prisoners need rehabilitative programs, they need real mental health treatment and they don’t need to be locked in a cell for 23 hours a day.”

The suit was filed with help of attorneys from Prisoners’ Legal Services and the state Mental Health Legal Advisors Committee.

Jenifer McKim is a reporter for the New England Center for Investigative Reporting, a nonprofit news partner of WGBH News. She can be reached at jenifer.mckim@necir.org