A gunman has attacked Canada's parliament shortly after a soldier was fatally shot at a nearby war memorial, forcing the capital Ottawa into lockdown.
The gunman was shot dead by the parliament's sergeant-at-arms, who has been hailed a hero by MPs who were caught in the building as dozens of shots were fired.
Local media have identified the gunman as Canadian-born Michael Zehaf-Bibeau, while the dead soldier was army reservist Nathan Cirillo (pictured).
Prime minister Stephen Harper was in the parliament meeting with MPs at the time and condemned the "despicable attack".
It was unclear whether there was any connection to an attack a day earlier when a man ran down two Canadian soldiers, killing one, near Montreal.
Canada announced this month it was joining the battle against Islamic State fighters who have taken over parts of Iraq and Syria.
Hours after the incident near Montreal, Canada raised its national terrorism threat level to medium because of a rise in "general chatter" from radical groups such as IS and Al Qaeda but said there had not been a specific threat.
The violence in Ottawa began about 10:00am (local time) when a soldier standing guard at the National War Memorial was shot in the chest with a rifle.
The dead soldier was identified as Nathan Cirillo, a 24-year-old reservist serving with the Argyll and Sutherland Highlanders of Canada regiment.
It is believed that Zehaf-Bibeau then ran to the nearby parliament building where he opened fire when confronted by security staff.
Photo: Nathan Cirillo was standing guard at the National War Memorial when he was shot and killed. (Facebook)
Prime minister Stephen Harper was in the building meeting with MPs at the time and was rushed away to a secure location. He later condemned the "despicable attack".
Cabinet minister Jason Kenney said a parliamentary guard was wounded in the exchange of fire.
"Condolences to family of the soldier killed, and prayers for the parliamentary guard wounded. Canada will not be terrorised or intimidated," Mr Kenney tweeted.
Ottawa Hospital said it had received four patients, three of whom were in a stable condition.
Police chief Charles Bordeleau urged calm but warned residents to stay away from the city centre.
"We are very aware of the large presence of military personnel in our community and I want them to know that we are committed to their safety," he said.
MPs barricade themselves inside meeting room
Mr Harper was addressing a meeting of members of his Conservative Party and was removed from the building. Some MPs were forced to barricade themselves in the room.
"I literally had just taken off my jacket to go into caucus. I hear this 'pop, pop, pop', possibly 10 shots," Liberal Party member John McKay told reporters.
"Suddenly the security guards come rushing down the hallways and usher us all out to the back of the parliament buildings."
Veterans affairs minister Julian Fantino, a former policeman, said parliament's head of security, Sergeant-at-Arms Kevin Vickers, shot dead a suspected gunman.
"All the details are not in, but the sergeant-at-arms, a former Mountie, is the one that engaged the gunman, or one of them at least, and stopped this," Mr Fantino said.
Photo: MP Nina Grewal took this photo of colleagues in the Conservative Party caucus room barricading themselves inside after shooting began. (Nina Grewal)
Witnesses to the Ottawa shooting said they saw a man armed with a rifle running into parliament after the shooting at the war monument.
A construction worker on the scene said he heard a gunshot, then saw a man dressed in black with a scarf over his face running towards parliament with a gun.
SoundCloud: North America correspondent Michael Vincent speaks to Canadian MP Charlie Angus
The man stopped a black car at gunpoint and hijacked it, construction worker Scott Walsh told Reuters.
The driver got out safely then the man drove the car to the Centre Block on Parliament Hill, where construction work is underway.
The gunman rushed past a woman with a child in a stroller, who ran away screaming. He did not attack the woman or child, Mr Walsh said.
Another witness, Marc-Andre Viau, said he saw a man run into the parliament precinct, chased by police who yelled "take cover".
That was followed by "10, 15, maybe 20 shots", possibly from an automatic weapon, he said.
Ottawa shooting: Canadian capital in lockdown after gunman fatally shoots soldier at war memorial; police search for more suspects - ABC News (Australian Broadcasting Corporation)