MONTREAL—A man who armed himself with high-powered weapons because he believed elves were stalking him will spend several weekend stints in prison after he was described as immature, but harmless.

David Abitbol had pleaded guilty to charges involving firearms, making online death threats and possessing child pornography.

On Thursday, a judge handed him the minimum possible sentence because he says Abitbol has gotten his life back in order. Abitbol will spend weekends in prison for the next three months.

He recently pleaded guilty to six charges, including uttering threats, possessing and distributing child pornography and improperly storing a firearm.

Provincial police initially moved in on Abitbol after he made threats on his Facebook page. At his home, they seized weapons and ammunition. Police later found child pornography on his computer.

Before his arrest, Abitbol told friends on the internet that he wanted to kill former school teachers and classmates. With the Polytechnique Massacre and the Dawson College shooting on their minds, the lawyers in the case hammered out an agreement.

“Today what we argued to the judge is that he is not the next Marc Lepine or the next Kimveer Gill,” said defence lawyer Charles Benmouyal.

The man had to give up his five weapons and won’t be allowed to own a firearm for a decade. Abitbol will also have to complete 240 hours of community service and will be on probation for three years.

The judge agreed with a joint recommendation that Abitbol's sentence be the minimum allowed by law. In handing down her sentence today, she said Abitbol had made significant strides since his arrest two years ago.

The prosecution insisted that it did not let Abitbol off the hook, but only agreed to the sentence after a lengthy psychological examination.

“The information that we have at this point, that was produced to the courts, is that the accused is immature but he presents no danger to society,” said prosecutor Steeve Lariviere.

So immature in fact that his parents still look after him, despite his holding a full-time job. Abitbol was described as a loner whose life is centered on fantasy-themed video games.

Part of his probation now prohibits Abitbol from using the Internet, or from being in the presence of children. He left the court room with instructions to show-up at the Bordeau jail on Dec. 15. Abitbol was again surrounded by his parents, who are now in charge of making sure he grows up and takes on the responsibilities of an adult.

—with files from The Canadian Press.