A funeral home in Longueuil was packed this afternoon for the funeral of Alain Magloire, the 41-year-old man who was shot dead by Montreal police on Monday.

Magloire was killed near the coach bus terminal in downtown Montreal after wielding a hammer in what police officers said was a threatening fashion.

"I was shocked when I heard he was on the streets, you know," said old friend Nicolas Lepore, who attended the funeral. "So how come a guy like that — so brilliant, so intelligent, so everything — was on the streets?"

Police were called to the scene on Berri Street after Magloire used the hammer to smash a nearby hotel's reception-area window.

The man, who was known at Montreal's Old Brewery, suffered from a mental illness his brother Pierre Magloire said was linked to having taken ecstasy at a party.

Magloire said his brother Alain’s life quickly spun out of control as a result, forcing him to leave his job as an educator and scientific researcher. He had voluntarily gone to live in the streets of Montreal in Nov. 2013, his brother told CBC News.

Magloire said his brother was carrying a hammer and other tools at the time of the shooting because he volunteered in construction work for a shelter in downtown Montreal.

Alain Magloire’s death has called attention to a number of social issues, including the way people with mental illnesses are handled by Montreal police.

On Friday, Quebec's chief coroner Denis Marsolais ordered a public inquiry into Magloire’s death. Coroner Catherine Rudel-Tessier will handle the case.

“Given that some emergency interventions in public places involving people suffering from mental illness have caused some deaths in recent years, it seems now is a good opportunity to proceed with a public inquiry,” reads the news release issued by the coroner’s office.

The release continued, mentioning that the coroner’s office wants to be able to make recommendations about reducing the risk of death in emergency situations involving people with mental health issues.

Magloire leaves behind two daughters, aged 8 and 12.