A Massachusetts man accused of bringing a mentally disabled woman to his family camp in Sebago to rape her was sentenced Tuesday in an indirectly-related child pornography case to four years in federal prison.

William Francis Duffy, 58, of Attleboro, Massachusetts, had child pornography on a computer seized by Cumberland County sheriff’s deputies after they were called to his Sebago camp on May 2, 2015, when the woman was able to surreptitiously call 911 for help, according to court records.

Authorities ultimately charged Duffy in two cases, one in state court for charges including rape and the other in federal court for a charge of possession of child pornography involving prepubescent minors.

Duffy pleaded guilty in the federal case on Feb. 23 before Judge George Singal in U.S. District Court in Portland. Evidence in that case included 4,475 still images and 261 video files of children being sexually abused, many depicting adults abusing prepubescent minors and infants, according to the U.S. Attorney’s Office.

Singal also sentenced Duffy on Tuesday to serve five years of supervised release after completion of his federal prison term. He was also ordered to pay $5,000 in restitution.

Duffy pleaded not guilty in the state case, and that case remains pending in the Cumberland County Courthouse in Portland. He is next scheduled to appear there on Wednesday for a dispositional conference.

In the state case, Duffy faces 54 charges – four counts of gross sexual assault, two counts of unlawful sexual contact and 48 counts of possession of sexually explicit material.

Duffy allegedly had an online chat with the 31-year-old woman over three weeks on a website for abused women. The woman complained of being abused and denied medication at her group home in Carver, Massachusetts.

Duffy offered to help her escape, the sheriff’s office said last year. She sneaked out and the pair drove to a camp in Sebago owned by Duffy’s parents.

Police said Duffy then had sex with the woman, who told an investigator she did not feel she could say no.

Police said the alleged victim appeared to have the intellectual capacity of a 9-year-old. She was able to secretly call police on a cellphone and hide the phone under her pillow as she and Duffy were having sex.

Cumberland County sheriff’s deputies working with the Regional Communications Center in Gray traced the call to Northwest River Road in Sebago, where they found Duffy and the woman.

Deputies executing a search warrant discovered a backpack containing sexual devices and other items, including heavy-duty plastic zip ties, a “pet safe” shock collar, two rolls of duct tape and two 100-foot lengths of rope.

During the encounter, Duffy threatened the woman and said if she did not have sex with him, he would tie her up and have sex with her anyway, the sheriff’s office said. Duffy also told her he was taking her to Rhode Island, which was where she thought she was, the sheriff’s office said.