MINNEAPOLIS (AP) — A convicted serial rapist should be allowed to be released into the community under supervision, the Minnesota state Court of Appeals ruled Monday, saying the state did not prove by clear and convincing evidence that Thomas Duvall should remain in treatment.

Department of Human Services Commissioner Emily Piper said Monday that she will appeal the provisional discharge of Duvall, in a case that once set off a political firestorm as lawmakers were considering changes to the state's treatment program for sex offenders.

"I have grave concerns about this decision," Piper said in a statement. "Three experts have previously testified that Thomas Duvall is not ready for life in the community and that he presents far too great a risk to public safety. I share that view and will exhaust every possible avenue of appeal."

Duvall, 62, has spent the last 30 years locked up for the violent rapes of teenage girls in the 1970s and 1980s. In 1987, he bound a Brooklyn Park girl with an electrical cord and raped her repeatedly over several hours while hitting her with a hammer. He was civilly committed as a psychopathic personality in 1991 and sent to the Minnesota Sex Offender Program.

Duvall has been in treatment since 2001 and was diagnosed as a sexual sadist. He has been in the final stages of the program since 2010, living outside the security perimeter at the facility in St. Peter, going on regular supervised community outings, volunteering at a thrift store, attending community support groups and preparing for transition into the community.

A special judicial panel ruled earlier this year that Duvall no longer required treatment in his current setting. A three-judge panel of the appeals court agreed Monday.

"The evidence demonstrates that Duvall continues to experience intrusive and deviant sexual thoughts, but that he has learned how to manage his thoughts," the appellate judges wrote, noting that evidence shows Duvall has succeeded in treatment.

The state argued Duvall had been dishonest and continued to have sexually violent fantasies, which he wrote about in journals that he destroyed. The state also argued the special judicial panel abused its discretion by not allowing one of Duvall's victims to testify, preventing the state from fully proving the nature of Duvall's sexual sadism.

The appellate court rejected that argument.

Duvall dropped a previous request for conditional release four years ago. While MSOP staffers had recommended his release at that time, Attorney General Lori Swanson objected. After Republican lawmakers also objected, Democratic Gov. Mark Dayton ordered his administration to oppose further releases until the program could be changed.

The U.S. Supreme Court last October declined to hear a major challenge to the constitutionality of Minnesota's civil commitment program for sex offenders. While a federal judge declared the program unconstitutional because few people had ever won release, the 8th Circuit Court of Appeals overruled him.

The program currently has 736 people in secure treatment facilities in Moose Lake and St. Peter. The Department of Human Services said 16 people are living in communities with supervision, while four others have been granted provisional discharge and are awaiting placements.