Canadian PM Stephen Harper has said his country “will never be intimidated” after a deadly attack near the national parliament in the capital Ottawa.
He pledged to “redouble our efforts” in fighting “terrorist” groups.
Earlier a gunman killed a soldier at an Ottawa war memorial, before dying in a shootout with police inside parliament.
This came hours after Canada raised its terror threat level. On Monday, another soldier was killed in a hit-and-run attack by a Muslim convert in Quebec.
Canada earlier this month announced plans to join the US-led campaign of air strikes against Islamic State (IS) militants in Iraq.
There is no confirmation that any of this week’s attacks are linked to IS or the new military campaign.
‘No safe haven’
In a televised address late on Wednesday, Mr Harper said: “We will not be intimidated. Canada will never be intimidated.”
He added: “In fact this will lead us to strengthen our resolve and redouble our efforts – and those of our national security agencies – to take all necessary steps to identify and counter threats and keep Canada safe here at home.”
He stressed that the perpetrators “will have no safe have” on Canadian soil, but admitted the attacks showed that Canada “is not immune to terrorist attacks”.
Mr Harper was addressing MPs at the time of the shooting but was safely evacuated.
Citing unnamed Canadian officials, US and Canadian news agencies identified the dead gunman as Michael Zehaf-Bibeau.
On Wednesday morning, two soldiers guarding the memorial came under fire from a man carrying a rifle.
One soldier, Cpl Nathan Cirillo, died of his injuries. Three other people were treated in hospital and released by evening.
Minutes later after the attack at the memorial, dozens of shots were fired inside the parliament building, Canadian MP Marc Garneau told the BBC.
Canadian parliamentary waiter Alain Merizier described seeing a dark car stop outside parliament’s centre block and a driver with “a long gun” get out and run inside the entrance of the building, pursued by a parliamentary officer.
He said: “I was astonished more than frightened. You don’t have time to be afraid.”
MP John McKay described the moment the gunman attacked parliament: “There was a pop, pop, pop sound so the guards ushered us to the back of the building.
“How the gunman was able to walk down the hall of honour inside parliament with a rifle will become an area of investigation.”