A Montana homeowner was sentenced Thursday to 70 years in prison, with no parole for at least 20 years, in the shotgun killing of a German exchange student who was trespassing in his garage.

A Missoula jury convicted Markus Kaarma, 30, of deliberate homicide in the case that caused an outcry in Germany and brought scrutiny to the state’s law allowing the use of deadly force in some situations to protect home and family.

Kaarma shot 17-year-old Diren Dede, who was unarmed, in April after he was alerted by motion sensors in his garage. Witnesses testified that Kaarma fired four times at the teen.

Dede’s father, Celal Dede, said after the sentencing: “It is justice. I am not happy. My son is dead.”

He and his wife attended the entire trial, and he returned from Germany for the hearing.

Kaarma sat staring down during the proceedings, occasionally glancing around the crowded courtroom. He had buzz-cut dark hair and wore an orange jail suit.

“I’m sorry my actions caused the death of Mr Dede,” he told the judge.

District judge Ed McLean heard testimony from several people before handing down the sentence, including Kaarma’s girlfriend, his mother, a detective, the teen’s host parents in Missoula and others.

Kaarma’s girlfriend, Janelle Pflager, told the judge she has received death threats against her 19-month-old son. She called Kaarma the “single-most misunderstood person I have ever met”.

“He is not a violent person,” Pflager said. “He didn’t want to kill anyone. He only wanted to make sure he and myself and son were alive at the end.”

Missoula County attorney Karla Painter asked Pflager if she said during a phone call with Kaarma in jail that she and Kaarma wouldn’t pay for the body of the Dedes’ “dirty rat son” to be shipped back to Germany for his funeral.

Pflager said she didn’t recall saying that.

Dr Douglas Johnson, a psychologist who interviewed Kaarma, testified that the defendant was remorseful about what happened but has an anxiety disorder that limits his ability to express his emotions.

Prosecutors argued Kaarma was intent on luring an intruder into his garage after it had had been burglarized at least once in the weeks before the shooting. Three witnesses testified they had heard Kaarma say he had been waiting up nights to shoot an intruder.

On the night of the shooting, authorities said, Kaarma left his garage door partially open with a purse inside. He fired four shotgun blasts, pausing between the third and fourth shots, witnesses said.

Lead detective Guy Baker testified that the first three shots were low and seemed to follow Dede as he moved across the garage. But the fourth shot was aimed higher and struck Dede in the head, Baker said.

Kaarma’s lawyers argued that the Missoula man feared for his life, didn’t know if the intruder was armed, and was on edge because of a previous burglary.

The self-defense principle is a centuries-old premise that a person has the right to defend their home against attack. More than 30 states, including Montana, have laws expanding the right of people to use deadly force to protect their homes or themselves, some known as “stand your ground” laws.

Kaarma said in court in December that he never intended to hurt anyone that night. He was sentenced by district judge Ed McLean.

Dede, from Hamburg, Germany, was studying at Missoula’s Big Sky high school and intended to leave the US after the school term ended a few weeks after the shooting.

His parents, Celal and Gulcin Dede, testified in December that they were unable to work or plan for the future after their son’s death.

Kaarma’s attorneys have said they will appeal his conviction to Montana’s supreme court.

Before sentencing, McLean rejected a motion from Kaarma’s attorneys asking for a new trial. His attorneys had argued that extensive news coverage of the case prevented the seating of an impartial jury.

As an alternative to a new trial, they asked the judge to declare a conviction on a lesser charge of mitigated deliberate homicide.

The case has prompted one Missoula lawmaker to draft legislation that would require violent entry into an occupied structure in order for the use of force to be justified.