MISSOULA, Mont. (AP) -- Just days before he killed a 17-year-old German exchange student, Markus Kaarma told hairstylists he had been waiting up to shoot some kids who were burglarizing homes.

He told them they would see it on the news.

Kaarma hoped to bait an intruder by leaving his garage door partially open and placing a purse inside, Montana prosecutors said. And when he did, a motion detector alerted him early April 27. Kaarma took a shotgun outside and almost immediately fired four blasts into the garage. Diren Dede, unarmed, was hit twice. He died after the final shot hit him in the head.

For those reasons, Kaarma's "castle doctrine" defense, which allows people to use deadly force to protect their home and family, failed him Wednesday. A Missoula jury convicted him of deliberate homicide.

Cheers erupted in the packed courtroom when the verdict was read. Dede's parents, from Hamburg, Germany, hugged and cried.

"It is very good," Dede's father, Celal Dede, said with tears in his eyes. "Long live justice."

Kaarma faces a minimum penalty of 10 years in prison when he is sentenced Feb. 11. His lawyers plan to appeal.

Dede's parents will give statements to the judge Thursday to consider at sentencing. Prosecutors asked for the hearing so the couple won't have to return to Missoula in February.

Kaarma's case was the latest in which a shooter invoked the castle doctrine, testing the boundaries of self-defense law.

In May, a 65-year-old Minnesota man was convicted of murder after lying in wait in his basement for two teenagers and killing them during a break-in. In July, an 89-year-old North Carolina man shot and killed a 47-year-old tenant who angrily demanded the landlord fix his air conditioning. Prosecutors declined to file charges.

Last year in Florida, a jury acquitted neighborhood-watch volunteer George Zimmerman in the 2012 death of 17-year-old Trayvon Martin. Zimmerman followed the teenager, contended the boy attacked him and got acquitted of murder even though he was not at his home at the time of the shooting.

More than 30 U.S. states, including Montana, have laws expanding the right of people to use deadly force to protect their homes or themselves, some of them known as "stand your ground" laws. The self-defense principle known as the castle doctrine is a centuries-old premise that a person has the right to defend their home against attack. The name evokes the old saying, "my home is my castle."

Montana's law allows homeowners to use deadly force to protect their property, but it requires them to act reasonably, University of Montana law professor Andrew King-Ries said.

"What the jury's saying here is, you have a right to defend yourself, but this isn't reasonable," King-Ries said. "Lots of people have guns here, and lots of people feel very strongly that comes with a responsibility to handle your weapon appropriately."

Kaarma's attorneys argued at trial that he feared for his life, didn't know if the intruder was armed and was on edge because his garage was burglarized at least once in the weeks before the shooting. They said Kaarma feared for his family's safety.

But jurors heard neighbors testify that Kaarma's girlfriend, Janelle Pflager, told them the couple planned to bait and catch a burglar because they believed police weren't responding.

They also heard from hairstylist Tanya Colby, who testified that Kaarma told her during a haircut: "I've been up three nights with a shotgun waiting to kill some kids." She said he later told her: "I'm not kidding, you're seriously going to see this on the news."

One of Kaarma's neighbors, Terry Klise, called the verdict a "huge weight lifted."

"The man was a threat to our neighborhood," Klise said of Kaarma.

The German government followed the case closely. Hamburg prosecutor Carsten Rinio said this week that his office had been investigating the Dede case, as required under German law.

"We are really grateful to everybody involved and particularly impressed by the outpouring of sympathy that Diren's parents experienced here in Missoula," Julia Reinhardt, with the German consulate in San Francisco, said Wednesday.

---

Associated Press writers David Rising in Berlin and Nicholas Riccardi in Denver contributed to this report.