The Michigan appeals court has ruled in favor of the state and dismissed a major class-action lawsuit by young prisoners who said guards failed to stop sexual assaults behind bars.

The court says Michigan's civil rights law doesn't apply to lawsuits by prisoners. It also dismissed the case on other technical grounds in a decision released Wednesday.

The lawsuit claims male prisoners, typically aged 16 or 17, were forced to engage in sex acts with adult prisoners and staff, with some abuse "open and obvious." The Corrections Department disputes the allegations.

A similar lawsuit citing violations of federal law still is pending in federal court in Detroit.

Hundreds of teens were housed with adults until 2012 when the Corrections Department assigned males under 18 to a single prison in Lapeer.