A federal judge has denied the state Department of Corrections' motion for summary judgment in a class-action lawsuit over health care quality in prisons.

The decision by U.S. District Judge Neil Wake was said to set the stage for the Oct. 20 trial on behalf of 33,000 inmates from Arizona's ten prisons.

The suits challenges the use of solitary confinement in Arizona's prison system and seeks better medical, mental health and dental care for inmates.

In June, the 9th Circuit Court of Appeals unanimously ruled the more than 30,000 prisoners could sue the state. Their decision rejected the state's argument that the inmates didn't have enough in common for class-action status. But the court said they could represent the prison population because all of them shared a common interest.

State prisons' failure to hire enough medical staff, failure to fill prescriptions, denial for inmates to access medical specialists and depriving suicidal and mentally ill inmates of basic mental health care were all listed by the court in June.

Prison officials have denied allegations of inadequate inmate care.

The American Civil Liberties Union, ACLU of Arizona and the Prison Law Office filed the suit in 2012.

Wake certified the case as a class action in March of last year, and the appeals court in San Francisco unanimously affirmed a lower court ruling in June.

The Associated Press contributed to this report.