Raymond Hansen, 36, was sentenced to 100 years at the Montana State Prison on Thursday for killing 63-year-old Terry Klein at a Sidney construction site last summer.

The killing was seemingly unprovoked. Richland County Deputy Attorney Tom Halvorson said whether Hansen was under the influence of drugs at the time of the killing was a confidential criminal matter.

Judge Richard Simonton issued the sentence, which went above a plea agreement’s recommendation for 70 years in the state prison. Hansen pleaded guilty to deliberate homicide in July.

Hansen will be eligible for parole after serving 25 years. He will receive credit for time served, which is roughly one year.

Hansen showed up to the job site on the morning of Aug. 24, 2016. Witnesses said he was acting erratically, and he wasn't part of the work crew.

He eventually climbed onto an excavator that Klein was operating. That's when prosecutors believe Hansen shot Klein. Another worker later saw that Klein wasn't moving and called 911.

Klein died from a gunshot wound to the head.

During the sentencing hearing on Thursday, the victim’s widow, three adult children and a grandchild all testified.

Hansen’s mother and sister testified on his behalf.

Richland County Attorney Mike Webber said Klein’s killing had hurt not just his family, but the entire town of Sidney, and that he was grateful to have the sentencing hearing over.

“Terry was a pretty well-known man,” Webber said. “He had many friends and he was a good person.”

Halvorson, the deputy county attorney, commended witnesses who testified Thursday. 

"We were impressed by the amazing strength of the members of the Klein family in giving their testimony," he said.