Thomas R. Duvall, a serial rapist who was at the center of a political firestorm three years ago over the future of the state sex offender program, insists that he is no longer a threat to society after nearly three decades in confinement and deserves to be released.

Duvall, 61, is expected to take the stand this week at the start of a four-day trial, which began Tuesday, before a state Supreme Court appeals panel considering his petition for conditional release. The Duvall case is widely seen as a key test of Minnesota’s law that provides for the indefinite commitment of violent sex offenders, and the courts’ willingness to override state officials who oppose an offender’s release.

Duvall, wearing a dark suit and glasses, looked on as the trial opened. More than two dozen witnesses are expected to be called, and likely will recount the horrific details of Duvall’s sexual crimes, which occurred in the 1970s and 1980s. In one particularly brutal assault in 1987, Duvall bound a teenage girl from Brooklyn Park with an electrical cord and raped her repeatedly over several hours while hitting her with the handle of a hammer. Duvall was convicted on three separate occasions of sexually assaulting teenage girls — each time shortly after he was released from prison.

While Human Services Commissioner Emily Piper and the Hennepin County attorney’s office oppose Duvall’s petition for conditional release from the Minnesota Sex Offender Program (MSOP), the outcome of the case is far from certain. State judicial panels, like the one hearing Duvall’s case, have shown greater willingness over the past two years to go against the recommendations of state administrators and approve offenders for conditional release to heavily monitored halfway houses in the community.

Three years ago, Duvall became a political flash point in the debate over the future of the MSOP. His petition for conditional discharge set off a political furor, ensnaring two prominent public prosecutors in a feud, and prompting Gov. Mark Dayton to temporarily suspend all releases from the facility. Duvall abruptly withdrew his petition just before the start of a public trial.

Among those closely following the case is the woman who survived Duvall’s brutal 1987 rape. The woman, who declined to reveal her name out of fear, said she continues to suffer “significant physical reactions” from the lasting trauma of the assault. “It’s like I’m living a nightmare,” she said in an interview. “There are times when I don’t know how I’m going to function from hour to hour.”

The woman, who was 17 years old at the time of the rape, said she has been unable to sleep, and has been hit with periods of nausea and vomiting since learning five weeks ago that Duvall had petitioned again for release. “I believe that people deserve a second chance, but I also don’t believe there is a treatment out there that can cure someone who has done what he has done to so many,” she said. “I just don’t want this to happen to anyone else.”

Dr. James Alsdurf, an independent forensic psychologist appointed by the court, concluded in a report recently filed under seal that Duvall should not be provisionally discharged into the community. He had done an extensive review of Duvall’s treatment history.

Attorneys for the state have seized on Duvall’s own writings — detailing his sexual thoughts and fantasies — to argue that he is unfit for reintegration into the community. During his confinement at MSOP, Duvall has been encouraged by treatment professionals to maintain personal journals of his inner thoughts. In journal entries in 2014 and 2015, he described deviant thoughts of rape and having sex with teenage girls, among other fantasies. He also used lewd language to describe female body parts, according to journal entries submitted to the court.

While it is common practice for psychologists to encourage offenders to maintain personal journals as a therapeutic tool, their content can be used as evidence that an offender may still be having violent and deviant thoughts and is a threat to the public.

“Would you agree that it’s problematic for someone like Duvall to have rape thoughts?” Assistant Attorney General Noah Cashman asked during court testimony.

Kristin Dehrkoop, a clinical supervisor at MSOP, responded from the witness stand, “I don’t know if his whole life will be devoid of deviant fantasies.”

Another concern highlighted by state attorneys is Duvall’s ongoing struggles with polygraph exams designed to verify whether he is telling the truth about his deviant fantasies. As recently as last month, he showed a deceptive response when asked about his masturbating to violent or deviant sexual thoughts. He showed a similar deceptive response in 2014 just weeks before the start of his last trial.

Yet in testimony Tuesday, more than a half-dozen MSOP employees, including therapists and administrators at St. Peter, painted a very different picture of Duvall than the one from his criminal record and personal journals. One by one, they approached the witness stand and described him as a model client, who mentors many of the younger offenders at MSOP, volunteers in the community and provides constructive feedback in therapy.

“Tom is probably the client that has worked the hardest at treatment ... and has come so far,” said Mary Beth Grady-Miner, a security counselor at MSOP.

MSOP has been under increased pressure from the federal courts to show that it’s not a de facto life sentence. In June 2015, U.S. Judge Donovan Frank in St. Paul declared the MSOP unconstitutional, citing the program’s low rate of release.

While that decision has been overturned by a higher court, state judicial panels have been approving a record number of offenders for release. In two years, a dozen offenders have been provisionally discharged from the MSOP, compared with only three in the program’s previous 20 years.