CALGARY -- The Alberta Court of Appeal says a trial judge was right to sentence a dangerous offender who tortured and starved his victim to an indefinite period in prison.

Dustin Paxton was convicted in 2012 for the prolonged and brutal abuse of a man who was his friend and roommate in Calgary.

A judge designated Paxton a dangerous offender, which allowed her to send him to prison for an indeterminate period of time.

Paxton challenged the sentence, but the Appeal Court's ruling released Tuesday said the trial judge was correct in her decision that an indeterminate sentence was the only way to adequately protect the public.

Paxton can apply for parole once he has served seven years of his sentence, but would need to prove he's no longer a danger to the public.

"Our review of the record and the sentencing judge's reasons as a whole satisfy us that the sentencing judge carefully considered all of the sentencing options and properly rejected all but the option of an indeterminate sentence," wrote Justice Peter Costigan on behalf of the court.

"The appellant's high risk for violent recidivism, the difficulty of treating his conditions, his history of disobeying orders, the lack of a timeline for successful treatment and the fact that no appropriate treatment options were available, support her conclusion that only an indeterminate sentence would adequately protect the public."

The same court rejected an appeal of Paxton's convictions in 2016. He tried to take that appeal to the Supreme Court of Canada, but the high court wouldn't hear it.

Paxton's victim was emaciated, battered and bleeding when Paxton dropped him off, near death, at a Regina hospital in April 2010.

During the trial in Calgary, court heard that Paxton humiliated, starved, beat and sexually assaulted his roommate over 18 months while they lived together in Alberta and Saskatchewan.

The man, who cannot be identified, testified that he suffered a traumatic brain injury from the abuse and could no longer hold a job.

He said he had trouble with his balance, couldn't swallow properly and had to drink through a straw. The man lost some of his lip during the prolonged ordeal, suffered broken ribs and sustained a ruptured bowel.

"Before the assaults, I was extremely good-looking and very attractive to women and now I am disfigured," he testified.

The trial heard how the smallest things such as leftovers in the fridge would provoke an attack. The victim testified that he took the abuse because he didn't want to look like "a sissy" and had dreams of making big money in a moving business he and Paxton had started.