Michael Gallacher, Associated Press
FILE - In this May 21, 2014 file photo, Marcus Kaarma, right, is followed into Missoula District Court by his wife Janelle with their child in Missoula, Mont. Jury selection began Monday, Dec. 1, 2014 in the trial of Kaarma, a Montana man charged with fatally shooting Diren Dede, a German exchange student who broke into his garage.

MISSOULA, Mont. — Attorneys for a Montana man say he was defending his home against a prowler when he fired a shotgun into his garage late one April night, killing a 17-year-old German exchange student.

Montana prosecutors contend that Markus Kaarma lured high-schooler Diren Dede into the garage by leaving the door partially open and a purse inside.

Opening statements in Kaarma's murder trial are set to begin Thursday in what's become another test of "stand your ground" laws in the U.S.

The laws make it easier for people to avoid prosecution in a shooting by saying they felt an imminent danger, whether or not the person shot was armed. Dede, from the German city of Hamburg, was not carrying a weapon.

The German government is closely following the case and has condemned the killing as out of proportion to any risk to Kaarma.

Prosecutors allege Kaarma fired four times without warning after an intruder tripped sensors he had installed.

It's not clear what Dede was doing in Kaarma's garage, though defense attorneys claimed this week that Dede, who played soccer at Big Sky High School in Missoula, was part of a band of teenagers burglarizing homes in town.

Days before, Kaarma had told a woman that his house had been burglarized twice and he had been waiting up nights to shoot an intruder, according to court records.

Paul Ryan, an attorney for Kaarma, has said there had been a number of break-ins in the neighborhood and Kaarma believed police weren't doing anything about it. He noted that Kaarma didn't know whether the person inside the garage was armed.

Ryan argued that Montana law allows homeowners to protect their residences with deadly force when they believe they are going to be harmed.

More than 30 states have laws expanding the self-defense principle known as the "castle doctrine," echoing the old saying, "my home is my castle."

That principle came under scrutiny in the 2012 shooting of an unarmed Florida teenager, Trayvon Martin, by a neighborhood watch volunteer who was following the 17-year-old. George Zimmerman was acquitted after arguing self-defense.

During jury selection this week, Kaarma's defense team objected to the fact that a student who was with Dede at Kaarma's property, Robby Pazmino, is out of the country and not immediately available to testify, The Missoulian reported. Pazmino, an exchange student from Ecuador, told police after the shooting that he watched Dede enter the garage but then ran off after hearing an unfamiliar voice and a shot.

Dede's parents, Celal and Gulcin Dede, attended jury selection accompanied by German attorneys.