A violent patient in Minnesota’s sex offender treatment program admitted in therapy that he was grooming his new roommate for sex, but the staff failed for weeks to intervene or prevent the rape that subsequently occurred.

The sequence of events, detailed in a recent state investigation, will result in the state paying $203,000 to settle a lawsuit by Michael Mrozek, the victim in the 2010 attack.

In addition, Deputy Human Services Commissioner Anne Barry has apologized to Mrozek, telling him by letter that the agency “sincerely regrets the sexual assault that was perpetrated upon you by your roommate.”

This is the second sexual assault in the Minnesota Sex Offender Program (MSOP) to produce a costly court settlement. In 2011, the state paid a patient $130,000 after he was assaulted by his roommate.

Human Services officials would not comment Wednesday on what steps they have taken to ensure that staff react when they learn that one patient may be sexually targeting another.

The MSOP, created in 1994, has come under intense criticism by patients and advocates, who argue that it fails to provide adequate therapy and amounts to unconstitutional indefinite detention. It houses nearly 700 offenders at prisonlike facilities in Moose Lake and St. Peter — most of them committed to state custody after completing prison terms for sex offenses. A federal judge in St. Paul is set to hear arguments over the constitutional issues surrounding the program in a trial that opens in February.

Interviewed by a state investigator, the accused patient, Brian Sorenson, described the methodical steps he took leading up to the attack inside the Moose Lake facility. At least one therapist knew about his plan in advance, according to the investigators’ report.

“Sorenson told me he was confronted in his treatment group, and he admitted to his therapist that he had gotten up in the middle of the night and laid down on Mrozek’s bed in an attempt to test Mrozek to see what he would do,” the investigator wrote. “Sorenson told me he had been grooming Mrozek by making sexual comments, roughhousing and asking him if he was gay. Sorenson told me Mrozek repeatedly told him that he was not gay and didn’t want to have sex with him.”

In the therapy session, Sorenson apologized to the staff for those actions and promised to refrain from making further advances, according to a second investigative report.

In that report, Mrozek allegedly told his therapists that he “did not need to be moved.” But Mrozek’s attorney, Jordan Kushner, said this week that the agency provided no documents to corroborate the comment. The investigator’s report also says the program’s staff knew that Sorenson had a history of assaultive behavior with his previous roommate — events unknown to Mrozek when he was paired to room with Sorenson, according to Kushner.

After the attack, the investigator wrote, Mrozek repeatedly said he was “afraid for his life, and he thought he might die at the hands of Sorenson.” At the time of the interview, he had cuts and bruises across his body, the investigator noted.

Sorenson, 41, was committed as a sexually dangerous person in 2007, according to MSOP records. In 1994, he was convicted of sexually assaulting a 42-year old woman. In 2004, while an inmate at the state prison in Rush City, he assaulted his cellmate, fracturing the inmate’s skull and breaking his ribs.

After the 2010 MSOP incident, Sorenson was convicted in Carlton County of raping Mrozek and sentenced to 17 years in the state prison at Stillwater.

Mrozek, 28, was convicted of having sex with juveniles and committed to the MSOP in 2010.