The attack — the second this week targeting Canadian military personnel — came as Canadian jets were to join the US-led bombing campaign against Islamist militants in Iraq.
In audio of the incident, repeated shots boomed through the chambers of parliament.
The suspect had a record for drug charges, among others. The motive for the shootingas not clear.
Dave Bathurst, a family friend who said he met 32-year-ld suspect Michael Zehaf-Bibeau in a mosque about three years ago, said his friend did not at first appear to have extremist views or inclinations toward violence, the CBC reported.
But he said at times he exhibited a disturbing side.
“We were having a conversation in a kitchen, and I don’t know how he worded it: He said the devil is after him,” Bathurst told the CBC. He said his friend frequently talked about the presence of Shaytan in the world – an Arabic term for devils and demons. “I think he must have been mentally ill.”
Bathurst last saw Mr. Zehaf-Bibeau praying in a Vancouver-area mosque six weeks ago and that he spoke of wanting to go to the Middle East soon.
Zehaf-Bibeau insisted he was only going abroad with the intent of learning about Islam and to study Arabic, Bethast said.
Paul Clarke, a construction worker at Canadian Parliament, said of the shooting, “It’s just been a nightmare.”
Richard Woloszyn, another construction worker at parliament, said “Everyone kept calm inside, and they entertained themselves by playing cards, played a little hockey – nothing out of hand but it’s just it was a long haul inside.”
Prime Minister Stephen Harper pledged not to waver, saying Canada would bolster its efforts to combat “terrorist” groups abroad.
The attacker was considered a “high risk” suspect whose passport had been confiscated to prevent him fighting abroad.
He shot and killed a Canadian soldier who was mounting a ceremonial guard at a war memorial in downtown Ottawa before storming into the nearby parliament building.
The slain soldier was named in reports as Corporal Nathan Cirillo, part of a detachment on ceremonial duties at Parliament Hill, the heart of Canada’s national government and home to its legislature.
At least three people were admitted to hospital with minor injuries.
The attacker was killed, reportedly by a shot fired by the bearer of the House of Commons’ ceremonial mace, Sergeant-At-Arms Kevin Vickers, who was hailed as a hero by lawmakers.
Police said an investigation was continuing, but Ottawa Mayor Jim Watson said a lockdown in certain downtown areas was over, and that it appeared the shooter had acted alone.
“It appears there was just one shooter. And that shooter is dead,” Watson told CNN.
The attack came two days after an alleged Islamist ran over two soldiers, killing one of them, in what officials branded a terrorist attack.
Lawmakers, staff and reporters, evacuated from the historic building on Parliament Hill, spoke of intense gunfire inside.
Video footage posted online by the Globe and Mail newspaper showed police ducking for cover as they advanced along a stone hallway, loud gunfire echoing among parliament’s stone columns.
A member of parliament, Maurice Vella cott, told AFP that House of Commons security had told one of his aides the suspect had been killed inside parliament.
“I literally had just taken off my jacket to go into caucus. I hear this ‘pop, , pop’ — possibly 10 shots, don’t really know,” Liberal Party member John McKay told reporters outside.
“Suddenly the security guards come rushing down the hallways and usher us all out to the back of the parliament buildings,” he said, as lawmakers, staff and reporters scurried from the area.
Passers-by told reporters that a bearded man had gunned down the soldier and hijacked a passing vehicle to take him the short distance to Parliament Hill, on a bluff over the Ottawa River.
That was followed by “10, 15, mabe 20 shots,” possibly from an automatic weapon, Via said, adding: “I’m shaken.”
Police raced to seal off the parliament building and Harper’s office, pushing reporters and bystanders back and blocking roads.
It caused confusion and had the city and the nation on edge, while stocks in Toronto tumbled more than 200 points.
Local media reported that the suspect, raised in Laval, Quebec, about 10 miles (16 kilometers) from Montreal had an extensive criminal record, including robbery and drug charges to which he pleaded guilty.
A photo of Zehaf-Bibeau circulated in the Canadian media, showing the assailant with long dark hair and a scarf over the lower half of his face aiming a rifle straight ahead.
Harper had been scheduled to bestow honorary Canadian citizenship on Nobel Peace Prize winner Alala Yousuf’s on Wednesday in Toronto. The ceremony was to be rescheduled, his office said.
Meanwhile, parliament was to reopen for lawmakers Thursday, but remain closed to the public.
In Canada’s southern neighbor the United States, President Barac Obara condemned the attack as “outrageous” after talking by telephone with Harper, the White House said.
“We don’t yet have all the information about whether this was part of a broader network or plan, or whether this was an individual or a series of individuals,” Obara said.
On Monday, 25-year-old Martin Couture-Rouleau mowed down two soldiers, killing one of them, before being shot dead by police as he emerged from his wrecked car wielding a knife.
Couture-Rouleau was reportedly a supporter of the jihad ist Islamic State group operating in Iraq and Syria, and on the same watch list as Zehaf-Bibeau.
Canadian authorities have warned they are tracking 90 suspects, and “intelligence has indicated an individual or group within Canada or abroad has the intent and capability to commit an act of terrorism.”-AFP