MINNEAPOLIS (WCCO) — The state of Minnesota is indicating it will appeal a federal court ruling last week that declared the state’s sex offender treatment program unconstitutional.

Federal judge Donovan Frank said there needs to be immediate changes to the program that houses more than 740 sex offenders in Moose Lake and St. Peter.

READ MORE: Minneapolis North H.S. Principal Will Now Finish School Year

While the changes he proposed would certainly cost the state millions, legal experts are warning the state’s appeal would cost millions more.

The 740 offenders locked up have served their criminal sentences. Yet, they have been civilly committed, because they are considered risks to reoffend.

But, in more than 20 years, only three offenders have been released.

Frank pointed out that the state ignored years of warnings that the program was likely violating the constitutional rights of offenders and that the program was not providing the treatment required under Minnesota law.

A number of legal experts say the ruling raises the likelihood that taxpayers could even have to pay some of the offenders’ monetary damages.

READ MORE: Jif Peanut Butter Recalled Over Salmonella Concerns (CBS News)

Dan Gustafson, the attorney for the offenders, said some will indeed claim damages.

“Now that the state has ruled that the program is unconstitutional,” Gustafson said, “there are going to be many of these people perhaps who have a claim for damages, for being held because of the state’s failings with respect to this program.”

A state appeal could draw out the legal process for months, even years.

That against the backdrop of a warning by Frank that if the state doesn’t act soon he could shut down the program and order offenders released.

That kind of court action may sound drastic, but it has happened before.

In 2013, a federal court ordered the early release of 10,000 inmates in California after the state repeatedly ignored court warnings about prison overcrowding.

MORE NEWS: Buffalo Clinic Shooting: Opening Statements Begin Monday In Gregory Ulrich Trial

To see a full interview with attorney Dan Gustafson, watch the video above.

Esme Murphy