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.
Canadian security sources later identified the gunman in Wednesday's shootings as Michael Zehaf-Bibeau, a Muslim convert in his early 30s.
He was recently designated as a "high-risk traveller" and had his passport taken away because of suspected jihadist sympathies, the BBC's Nick Bryant in Ottawa says.
Earlier this month, Canada announced plans to join the US-led campaign of air strikes against Islamic State (IS) militants in Iraq.
However there is no official confirmation that any of this week's attacks are linked to IS or the new military campaign.
In a televised address late on Wednesday, Mr Harper said: "We will not be intimidated. Canada will never be intimidated."
"In fact this will lead us to strengthen our resolve and redouble our efforts... to take all necessary steps to identify and counter threats and keep Canada safe."
Mr Harper stressed that the perpetrators "will have no safe haven" in Canada, but admitted the attacks showed that the country was "not immune to terrorist attacks".
Mr Harper was addressing MPs at the time of the shooting but was safely evacuated.
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.
The gunman was shot dead by Sergeant-at-arms Kevin Vickers, 58.
"MPs and [Parliament] Hill staff owe their safety, even lives, to Sergeant at Arms Kevin Vickers who shot attacker just outside the MPs' caucus rooms," New Democrat MP Craig Scott tweeted.
Michael Zehaf-Bibeau is known to have a police record for petty crime, such as possession of drugs and robbery, our correspondent adds.
In his evening address, Mr Harper described him as a terrorist. "In the days to come we will learn more about the terrorist and any accomplices he may have had," he said.
(BBC)