The gunman who shot and killed a soldier in plain daylight then stormed Canada's Parliament once complained that Vancouver mosque he attended was too liberal and inclusive, Muslim leaders said Friday.

Assam Rashid, spokesman for the British Columbia Muslim Association, said Michael Zehaf-Bibeau, 32, visited the Masjid Al-Salaam mosque for several months in 2011 before he was told not to come back.

Rashid said the association has been working on a preventive program that focuses on minimizing the effect of terrorist and criminal propaganda in Canada.

Zehaf-Bibeau shot a soldier to death at Canada's national war memorial Wednesday, and was eventually gunned down inside Parliament by the sergeant-at-arms.

Canada's Prime Minister Stephen Harper has called the shooting a terror attack, and the bloodshed raised fears that Canada is suffering reprisals for joining the U.S.-led air campaign against Islamic State extremists in Iraq and Syria.

The attack in Ottawa cane two days after a man described as an "ISIL-inspired terrorist" ran over two soldiers in a parking lot in Quebec, killing one and injuring the other before being shot to death by police. The man had been under surveillance by Canadian authorities, who feared he had jihadist ambitions and seized his passport when he tried to travel to Turkey.

Police have said Zehaf-Bibeau was not being watched, and the motivations behind his attack remains obscure. However, a top police official said Zehaf-Bibeau -- whose father was from Libya -- may have lashed out in frustration over delays in getting his passport.

"I think it was central to what was driving him," said Royal Canadian Mounted Police Commissioner Bob Paulson.

Unlike the Quebec case, Zehaf-Bibeau's passport had not been revoked or his application rejected, but authorities were still investigating whether to grant him one, Paulson said. The wait appeared to weigh heavily on Zehalf-Bibeau.

Abubakir Abdelkareem, who often visited the Ottawa Mission, a homeless shelter downtown where Zehaf-Bibeau stayed in recent weeks, said Zehaf-Bibeau told him he had had a drug problem but had been clean for three months and was trying to steer clear of temptation by going to Libya.

But in the three days before the rampage, "his personality changed completely," Abdelkareem said. He stopped being talkative and sociable and slept during the day, said Abdelkareem, who concluded Zehaf-Bibeau was back on drugs.

Lloyd Maxwell, a shelter resident, said that Zehaf-Bibeau had come to Ottawa specifically to try to get a passport, believing that would be more easily accomplished in the nation's capital.

"He didn't get it, and that made him very agitated," Maxwell said.

In an email to the AP expressing horror and sadness at what happened, Zehaf-Bibeau's mother, Susan Bibeau, said that her son seemed lost and "did not fit in," and that she hadn't seen him for more than five years until having lunch with him last week.

In a brief and tear-filled telephone interview with the AP, Bibeau said that she is crying for the victims of the shooting rampage, not her son.

"Can you ever explain something like this?" said Bibeau, who has homes in Montreal and Ottawa. "We are sorry."