Canada is in shock after a gunman shot and fatally wounded a soldier at the National War Memorial in Ottawa and then stormed into Canada's parliament before being shot dead. The BBC profiles the suspected gunman, widely identified as 32-year-old Michael Zehaf-Bibeau.
Canadian police say Zehaf-Bibeau was a Canadian-born petty criminal who may also have held Libyan citizenship.
Royal Canadian Mounted Police (RCMP) commissioner Bob Paulson said on Thursday that Zehaf-Bibeau had recently applied for a new passport, and authorities now believe he intended to go to Syria.
"The passport was part of his motivation," he told a press conference.
"His application was not rejected. His passport was not revoked. He was waiting to get it and there was an investigation going on to determine to see whether he would get a passport."
Mr Paulson said Zehaf-Bibeau was not among 90 individuals known to Canadian security forces as a "high-risk traveller" - contrary to initial reports.
Nor was he linked to the Muslim convert who on Monday killed a Canadian soldier in Quebec in a hit-and-run attack.
Mr Paulson said Zehaf-Bibeau's criminal records were related to drugs, violence and "other criminal activities".
He said police were trying to piece together how Zehaf-Bibeau acquired a Winchester lever-action gun, as he was banned from owning firearms because of his criminal convictions.
Mr Paulson added that Zehaf-Bibeau's email address had been found in the computer hard-drive of someone charged with a "terrorist-related offence", but he did not give details.
Court documents show Zehaf-Bibeau was convicted of several petty crimes during the early 2000s, spending several days in jail.
He was charged in Quebec for crimes including credit card fraud and multiple counts of drugs possession.
In Vancouver in 2011 he was also charged with robbery and making threats. A psychiatric assessment at the time considered him fit to stand trial.
Zehaf-Bibeau grew up in Laval, a city north of Montreal in Quebec.
Neighbours of his family told broadcaster CBC that Michael Zehaf-Bibeau had been "a sweet boy", and that they were shocked by the news.
Canadian media said his father, Bulgasem Zehaf, was originally from Libya and ran a cafe in Montreal. His mother, Susan Bibeau, worked at Canada's Immigration and Refugee Board. The two were said to have divorced in 1999.
They released a joint statement on Thursday saying "no words can express the sadness we are feeling at this time".
They said they were "so sad" that Cpl Nathan Cirillo, the soldier shot at the National War Memorial, had lost his life and apologised for the "pain, fright and chaos" their son created.
Susan Bibeau wrote that they had "no explanation to offer", saying she spoke to her son over lunch last week having not seen him for more than five years.
Police said they seized items belonging to Zehaf-Bibeau from the Ottawa Mission, a homeless shelter, late on Wednesday.
The mission's residents told CBC News that he had been seen frequently at the mission over the last two weeks.
Shelter resident John Clothier told CBC that Zehaf-Bibeau was "desperately" trying to buy a car because his old one had broken down.
"People were trying to help him, but we didn't understand what he was up to," Mr Clothier said. "He acted bizarre, he did. Very bizarre."
Canadian newspaper the Globe and Mail spoke to Dave Bathurst, who said he had become friends with the suspect after they met in a mosque three years ago.
Mr Bathurst said his friend did not appear to have extremist views at first, but had displayed some "erratic" behaviour.
"We were having a conversation in a kitchen, and I don't know how he worded it: he said the devil is after him," Mr Bathurst said. "I think he must have been mentally ill."
They last met at a mosque six weeks ago, when Zehaf-Bibeau said he wanted to "go back to Libya to study".
He insisted that he was only going abroad with the intent of learning about Islam and to study Arabic, Mr Bathurst added.