RUMFORD — A former high school honor student from western Maine is going to prison for 40 years for killing two men in Rumford.

Richard Moulton of Mexico was sentenced today in Oxford County Superior Court. The sentence was the maximum allowed under a plea agreement last November in which the 22-year-old Moulton pleaded guilty in the 2009 shooting deaths of Victor Reed Sheldon and Roger Leroy Day, Jr.

Moulton and his friend Eric Hamel killed Sheldon and Day in Day’s apartment. Hamel has pleaded guilty to two counts of murder. He’s scheduled to be sentenced in September.

Moulton told investigators that his girlfriend, who was Sheldon’s estranged wife, planned the killings as payback.

Gayla Sheldon pleaded guilty last month and was sentenced to 15 years for helping plan the killings.