JACKSON, Miss. — On the witness stand and under pressure, Frank Shaw, the warden of the East Mississippi Correctional Facility, could not guarantee that the prison was capable of performing its most basic function.

Asked if the guards were supposed to keep inmates in their cells, he said, wearily, “They do their best.”

According to evidence and testimony at a federal civil rights trial, far worse things were happening at the prison than inmates strolling around during a lockdown: A mentally ill man on suicide watch hanged himself, gang members were allowed to beat other prisoners, and those whose cries for medical attention were ignored resorted to setting fires in their cells.

So many shackled men have recounted instances of extraordinary violence and neglect in the prison that the judge has complained of exhaustion.