Quebec court Judge Jean-Pierre Boyer also declared Jeffrey Labelle a danger to himself and to his family and ordered the 21-year-old to undergo a psychiatric evaluation.
The court heard testimony that hinted at a deeply troubled, paranoid young man who had recently tried to kill himself and allegedly converted to a violent form of Islam.
"I am appropriating (the Crown's) use of the term 'lone wolf,' to describe the accused...he is a danger to society," Boyer said.
The Crown said Labelle's mother told police her son had been acting erratically over the past three months, pulling out his hair and throwing himself against the walls of their home.
Crown prosecutor Sylvie Lemieux told the court the mother also informed police her son started carrying around knives and had allegedly dug an emergency underground shelter in a Montreal park.
Police have said they found survival gear, a hatchet and tools at the shelter.
Labelle would sometimes spend nights asleep by the shelter he dug after arguing with his mother, Lemieux said.
Police searched Labelle's home last Friday and said they found a city map that showed the co-ordinates of four different police stations. They also said they found two sabres, a Rambo knife and other smaller knives at the home.
Labelle faces one charge under the terrorism hoax section of the Criminal Code, having allegedly given police reason to believe a terrorist activity could occur.
The arrest followed a joint investigation with the RCMP that began when police were tipped off by social workers who had spoken to the suspect's mother.
Lemieux noted that Labelle's mom allegedly told social workers and, later police, that her son threatened to carry out a terrorist attack.
Lemieux testified that, according to the mother, Labelle told her after watching footage of the Islamic State in Iraq and Syria "that you will see me on TV after I do something grandiose and you should be proud of me."
Labelle's lawyer, Julie Bernier, argued her client never directly threatened anyone and that he should have been placed into the custody of his grandmother.
The grandmother told the court she had taken care of her grandson since he was eight.
Last Tuesday morning Labelle snapped after his mother walked out of the bathroom covered in blood because she had "mutilated herself," the grandmother testified.
Boyer said Labelle's home life did not provide a "safety net" and that given the recent murders of Canadian soldiers by people allegedly having acted with Islamist motives, the accused had to remain incarcerated in order for the public to have confidence in the justice system.
"We are in a particular era," Lemieux said about the recent shootings in Canada. "There are things that are happening in the world and we can't ignore them."
Labelle is detained pending an evaluation and is due back in court Jan. 23.
ALSO ON HUFFPOST: