The Maine Supreme Judicial Court on Thursday unanimously upheld the 40-year sentence of an Old Orchard Beach man who admitted he killed his roommate in March 2019.

Dustan Bentley, 33, pleaded guilty in February to murder in the death of 65-year-old William Popplewell. An autopsy found Popplewell died from blunt force trauma, multiple sharp force injuries and ligature strangulation.

In exchange for Bentley’s plea, the Maine attorney general’s office agreed that it would recommend a sentence that was not longer than 40 years.

Bentley claimed in the appeal that Superior Court Justice Wayne Douglas based it on other murder cases that weren’t comparable to Bentley’s and failed to take into account factors that were unique to his case.

The attorney general’s office argued that the judge’s imposition of a 40-year sentence took into account Bentley’s acceptance of responsibility by pleading guilty. The prosecutor also said in his brief that sentencing courts are permitted, but not required, to consider comparable cases whether a defendant is found guilty by a jury or enters a guilty plea.

Justices heard oral arguments in Bailey’s appeal in June, the same day it considered the appeal of F “Frank” Daly, a man serving 42 years in prison for murdering a Bangor man in January 2018.

Daly, 33, of Bangor was found guilty by a jury in September 2019 of shooting to death 51-year-old Israel Lewis at the Second Street boarding home where he lived in Bangor.

Justices unanimously upheld his conviction and sentence earlier this month.

Bentley and Daly are incarcerated at the Maine State Prison in Warren, according to the Maine Department of Corrections.