Government leaders gathered in a show of resolution a day after a deadly attack on Canada's Parliament, as authorities and everyday Canadians sifted through confounding shards of the gunman's life seeking to understand what motivated the man to storm the nation's seat of power.

The emerging portrait of Michael Zehaf-Bibeau is a fragmented one: A misfit who went more than five years without seeing his mother. A crack cocaine user who once told a psychological evaluator he wanted to go to jail to beat his addiction. A committed Muslim who said he wanted to become a better man, but in recent weeks seemed to come unglued. A homeless shelter resident who talked about wanting to go to Libya — or Syria — and became upset when he couldn't get a passport.

A day after the 32-year-old Canadian launched what the prime minister called a terrorist attack, a top police official said Thursday that 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 on Thursday.

Bibeau shot a soldier to death at Canada's national war memorial Wednesday, then stormed the Parliament building, where he was gunned down by the sergeant-at-arms. Police said he was armed with a lever-action Winchester rifle, an old-fashioned, relatively slow-firing weapon.

The deadly attack was the second on Canadian soldiers in three days, forcing the country to confront the danger of radicalized citizens in its midst and exposing weak spots in security:

— During the attack, Prime Minister Stephen Harper hid in a closet-like space within a Parliament caucus room. The Mounties who are assigned to protect him were on the other side of the room's doors. The Mounties will now guard the prime minister around the clock, wherever he goes, Paulson said.

— After the tragedy, all members of the Canadian military were ordered to avoid wearing their uniforms in public while doing such things as shopping or eating at restaurants.

— Earlier this week, the Mounties said about 90 people nationwide are suspected of planning to join up with extremist fighters abroad or have returned from such activity. But Paulson said Thursday that Zehaf-Bibeau was not on that list and was not under surveillance, partly because it was not until after the shooting that authorities learned from his mother that he wanted to go Syria, where a host of militant groups such as Islamic State are fighting.

— Authorities are investigating how the gunman obtained the rifle, when he should been prohibited from possessing one because of his criminal record.

Zehaf-Bibeau's passport, meanwhile, hadn't been revoked or his application rejected, but authorities had been investigating whether to grant him one, Paulson said. That obstacle appeared to weigh heavily on Zehalf-Bibeau, a petty criminal with a long rap sheet, including drug and weapons offenses, assault and robbery.

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."

While living in Vancouver in 2011, Zehaf-Bibeau was arrested on a robbery charge. During a court-ordered psychological evaluation, he said he committed the crime for the sole purpose of getting incarcerated.

"He wants to be in jail as he believes this is the only way he can overcome his addiction to crack cocaine," the evaluation report said. "He has been a devoted (Muslim) for seven years and he believes he must spend time in jail as a sacrifice to pay for his mistakes in the past and he hopes to be a better man when he is eventually released."

The evaluator said that while Zehaf-Bibeau was making "an unusual choice," he didn't appear to be mentally ill. He pleaded guilty to a lesser charge of making threats and was released after just over two months.

While in the Vancouver area in 2011, Zehaf-Bibeau went to a mosque and met a fellow attendee who hired him for a manual labor job at his family's landscaping business, said the fellow mosque-goer's father, John Bathurst. Zehaf-Bibeau quit after two days, and Bathurst said his son didn't see Zehaf-Bibeau again until six weeks ago and found "he was talking about the devil and talking about stuff that was pretty unhealthy. The real story here is mental illness."

The mosque released a statement saying members were concerned at hearing reports that the gunman might have attended.

After initially reporting that two or three assailants may have taken part in the shooting rampage, Canadian police conceded Thursday that Zehaf-Bibeau was the lone gunman.

The bloodshed raised fears that Canada is suffering reprisals — perhaps so-called lone-wolf attacks — for joining the U.S.-led air campaign against Islamic State extremists in Iraq and Syria.

On Monday, 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. Before the attack, Canadian authorities feared he had jihadist ambitions and seized his passport when he tried to travel to Turkey.

The prime minister noted Thursday that both attacks were carried out by citizens born in Canada.

Paulson said Zahef-Bibeau's history of crime, violence, drugs and "mental instability" contributed to his radicalization. Zehaf-Bibeau's email was found on the hard drive of someone charged with a terrorist-related offense, Paulson said. He didn't say who and described the connection as tenuous.


Associated Press writer Rob Gillies reported from Toronto. La Corte contributed from Vancouver and Associated Press writer Raphael Satter contributed from London.