MINNEAPOLIS (AP) — A federal appeals court has reversed a lower court decision that declared Minnesota's sex offender program unconstitutional because it holds people long after they complete their prison sentences.

A three-judge panel of the 8th U.S. Circuit Court of Appeals on Tuesday sided with the state and sent the case back to a lower court for further proceedings.

Only a handful of offenders have won provisional releases in the 20-plus-year history of the Minnesota Sex Offender Program. That led U.S. District Judge Donovan Frank in 2015 to declare it unconstitutional and order changes to make it easier for people to get on a path for release.

A lawsuit filed on behalf of more than 700 offenders argued that the program amounts to a life sentence because hardly anyone gets out.