Prolific sexual predator Kenneth Hornby threatened to kill himself as a Calgary judge declared him a dangerous offender and sentenced him to prison indefinitely.

Hornby, 60, has a 30-year history of molesting young boys. Most recently, in 2017, he sexually assaulted a five-year-old boy in an alley.

On Friday afternoon, Court of Queen's Bench Justice Suzanne Bensler delivered her sentencing decision, siding with prosecutors Vicki Faulkner and Zailin Lakhoo, who sought an indeterminate sentence for Hornby.

Hornby yelled at the judge that he could not spend any more time in jail.

"I'm going to kill myself as soon as I get the first chance," he told Bensler. "I've been stabbed ... everybody in Bowden [prison] wants to kill me."

If Hornby responds sufficiently to treatment, he could be released, but the Parole Board of Canada would have to be satisfied that the risk to the community would be low.

"No lesser measure will adequately protect them," said Bensler.

In 1995, Hornby said during a CBC interview there was no guarantee he would be able to stop abusing children despite his involvement in some of the country's most intensive treatment programs.

Hornby's latest crime was the sexual abuse of a five-year-old boy in a Calgary alley in May 2017.

His criminal history dates back to 1986, when he was convicted of gross indecency in Calgary for molesting two young boys, ages 13 and eight. He was sentenced to 18 months in jail.

He received the same sentence again in 1987 after convictions for sexual assault. Again, his victims were young boys.

Kenneth Hornby has a 30-year history of sexually abusing young boys. In 1995, he participated in a CBC documentary on the mind of a pedophile. (CBC)

Another sexual assault conviction came in 1992 with a 30-month sentence for molesting a 10-year-old boy.

Hornby's criminal record then took a lengthy break before he was found guilty of possessing child pornography in 2017.

The next year, he sexually assaulted the boy in the alley.

Court-appointed psychiatrists and psychologists have found Hornby shows no remorse and no guilt. He is considered a high risk to reoffend.

Despite extensive participation in various programs designed to keep Hornby from reoffending, the most recent court-ordered assessment found "further treatment efforts are likely to have diminishing returns given his previous extensive treatment exposure," according to psychiatrist Dr. Kenneth Hashman.