One of the more prolific and unrepentant predator priests in the Chicago area has been released from custody after 17 years in prison.

Former Catholic priest Vincent McCaffrey gained his freedom months earlier than his previously scheduled release because of a federal law signed last year by President Donald Trump that cuts inmates an additional break if they behave behind bars.

McCaffrey, who admitted sexually abusing so many boys that he lost count, pleaded guilty in 2002 to receipt and possession of child pornography. He was sentenced by a federal judge in 2003 to 20 years in prison.

Originally slated for release Nov. 18, McCaffrey instead was freed July 19 “in accordance with the revised good-conduct-time provisions provided in the First Step Act,” according to the U.S. Bureau of Prisons.

Since then, he’s been living in motels in the north suburbs.

The new law, which U.S. Sen. Dick Durbin, D-Illinois, cosponsored, “was the culmination of a bipartisan effort to improve criminal justice outcomes as well as to reduce the size of the federal prison population while also creating mechanisms to maintain public safety,” according to the federal government.

Before the measure took effect, “Inmates could earn up to 47 days of good-time credit for every year of their sentence served,” according to the prisons bureau. Now, “Federal inmates can earn up to 54 days of good-time credit for every year of their imposed sentence rather than for every year of their sentenced served.”

More than 3,000 inmates nationwide were given early release on or around July 19 because of the new law, records show.

Under the terms of McCaffrey’s release, he must stay away from sexually explicit material, alcohol and children in unsupervised settings, court records show.

McCaffrey had been held in a low-security prison in Ohio from September 2018 until his release, records show, though he did most of his prison time at the Federal Medical Center, Devens in Massachusetts.

McCaffrey, 67, wouldn’t comment. Approached at the motel where he’s living, he handed back a Sun-Times reporter’s business card, closed the door and pulled the blinds.

The Archdiocese of Chicago, the arm of the Catholic church for Cook and Lake counties overseen by Cardinal Blase Cupich, wouldn’t discuss McCaffrey other than spokeswoman Anne Maselli saying he has been on a publicly available list of abuser priests since 2006.

Aides to Cupich would not say whether McCaffrey is getting a church pension through a retirement plan run by the archdiocese that’s funded in part by churchgoers’ donations from the pews.

Church leaders knew McCaffrey was molesting boys in the 1970s and 1980s but didn’t report him to the police or remove him from ministry. Instead, they sent him for what they described as treatment and kept transferring him to new parishes without informing the church communities, and he continued to sexually abuse minors.

He quit the priesthood in the early 1990s under pressure from the archdiocese, which gave him more than $80,000 to start a new life.

By 2002, he was living in his own condominium on the North Side and buying vast amounts of child pornography over the Internet. That came to light when a kiddie porn operation in New Zealand was busted: McCaffrey was a customer.

Federal agents who raided his home found more than 4,000 graphic images — including “sadomasochistic and sadistic” photos, several showing a young child in a cage — on McCaffrey’s computer as well as on printouts and CDs.

McCaffrey told the agents he used child porn “as a sexual release to keep him from going out into the community and doing those things.”

He said “he viewed child pornography as a victimless crime,” to which a federal agent responded in court testimony, “It’s far from it,” records show.

McCaffrey was arrested and convicted in 2002, and his condo was seized.

Federal authorities introduced past allegations of sexual abuse — which he hadn’t been charged with because they were state crimes for which the statute of limitations had expired — to boost his prison sentence for child porn.

Apparently hoping to get a break on his sentence, McCaffrey admitted under questioning by prosecutor T. Markus Funk that he was “a serial molester.”

“You had approximately 100 sexual contacts with children while you were an adult. Is that an accurate figure?” Funk asked.

“I don’t know,” McCaffrey answered.

“Once again, you lost count, right?” Funk asked.

“Yes,” McCaffrey replied.

“Because you’re a serial molester, aren’t you?”

“Yes.”

“A predator — . . . “

“Yes.”

“. . . of young boys?”

“Yes.”

“Who cannot be cured.”

“No,” McCaffrey agreed. “I cannot be cured, right.”

But he insisted that, with treatment, he “keeps it in check.”

At the time, the two decades McCaffrey was sentenced to was the longest prison term ever given in the United States in such a case.

McCaffrey grew up on the South Side. A troublesome seminarian, he was ordained a priest in 1978. Early on, he was seen by some parishioners as a dynamic minister. He played guitar, sang Irish songs, seemed to connect with young people.

But he proved to be a cunning predator. One victim testified McCaffrey abused him “way over 200 times.”

Another man who testified about being abused by McCaffrey as a child said, “I really haven’t been to church since my confirmation” — the coming-of-age sacrament. He said that was “the last time I was molested.

“He gave me communion an hour before,” the man testified. “I don’t believe in God. I really don’t. I feel, like, dead.”

McCaffrey was suspected of molesting kids in church rectories and at his Wisconsin vacation cottage, among other places, church and court records show. He’d sometimes get them drunk, sleep naked with them, rubbing their bodies or engaging in oral sex, the records show.

The archdiocese has been sued over McCaffrey, but won’t say how much has been paid out in legal settlements.

McCaffrey was assigned to parishes in Calumet City, Hometown and Wheeling in addition to Chicago. His assignments included St. Victor, Our Lady of Loretto, St. Joseph the Worker, St. Josaphat and Our Lady of Good Counsel.

McCaffrey was prosecuted around the time that revelations of widespread priestly abuse and coverups by bishops were emerging in Boston, the epicenter of a new wave of sexual scandal that has since spread around the globe.

Funk asked McCaffrey on the witness stand whether he had told someone he felt like a victim and was “being made a poster child like that priest in Boston.”

McCaffrey responded, “Possibly yes.”

Contributing: Jon Seidel