Media playback is unsupported on your device Media caption RCMP Commissioner Bob Paulson explains what the CCTV shows

Police in Canada have released video showing how a lone gunman stormed into Canada's parliament on Wednesday.

Minutes before, Michael Zehaf-Bibeau, 32, had shot dead a soldier at Ottawa's war memorial near parliament.

Zehaf-Bibeau was ultimately shot dead by Sergeant-at-Arms Kevin Vickers.

He was not on a list of known high-risk travellers, but had links to extremist elements, police said. He had recently applied for a passport and intended to travel to Syria.

At a news conference on Thursday, Royal Canadian Mounted Police (RCMP) Commissioner Bob Paulson described Zehaf-Bibeau as a Canadian-born petty criminal with possible dual citizenship in Libya, where his father was from.

Mr Paulson said Zehaf-Bibeau was not among the 90 individuals known to Canadian security forces as a "high-risk traveller", contrary to earlier reports.

Nor was he linked to the Muslim convert who on Monday killed a Canadian soldier in Quebec in a hit-and-run attack.

"[Zehaf-Bibeau] was an individual who may have held extremist beliefs," said Mr Paulson, who suggested the passport application process may have driven him to violence.

"I think the passport figured prominently in his motives. I'm not inside his head, but I think it was central to what was driving him."

Killed in the Wednesday morning attack was Cpl Nathan Cirillo, a 24-year-old reservist from Ontario who was standing as an unarmed honour guard, in ceremonial dress, at Canada's Tomb of the Unknown Soldier near the Canadian capital's Parliament Hill.

According to the RCMP investigation, Zehaf-Bibeau arrived in Ottawa on 2 October, intending to deal with an issue related to his application for a passport.

"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.

On Tuesday, he purchased the beige car used in the attack. On Wednesday at about 09:50, he approached the war memorial from behind, fired twice at Cpl Cirillo, who never saw him coming, then fired on the second guard. Cpl Cirillo was struck, but the shot missed the second guard.

Zehaf-Bibeau yelled something in English, then drove north on Wellington Street toward Parliament Hill. He stopped his car directly in front of the parliament complex's East Block, and alighted from his vehicle brandishing a rifle as pedestrians fled.

Media playback is unsupported on your device Media caption Sergeant-at-Arms Kevin Vickers was given a standing ovation in parliament

Video shows he hijacked a minister's car, then sped off toward Centre Block, by now pursued by police.

At Centre Block, he left the stolen car and ran into the building, exchanging gunfire with House of Commons security forces and RCMP officers.

He was ultimately shot dead by Sergeant-at-Arms Vickers, a former senior RCMP officer, who received a standing ovation in parliament on Thursday.

Only one minute and 23 seconds elapsed between the time Zehaf-Bibeau parked his own car and when he entered Center Block.

At the scene: Jon Kelly, BBC News, Ottawa

Rows of squad cars blocked the National War Memorial, where a gunman shot and killed a soldier before rampaging through the parliament building.

By the standards of most Western cities, these security measures appeared restrained in the wake of a deadly attack.

But in a nation where the openness of political institutions is a deeply-cherished article of faith, they were a sign that something was out of the ordinary.

Can Canada preserve its openness?

Image copyright AP Image caption Cpl Nathan Cirillo was unarmed when he was shot from behind

Zehaf-Bibeau's assault has shaken a nation already reeling from Monday's attack in Saint-Jean-sur-Richelieu, in which 25-year-old Martin Couture-Rouleau smashed his car into two Canadian soldiers in a car park, killing one.

Couture-Rouleau, who authorities say was "inspired" by Islamic State (IS) militants in Iraq and Syria, led police on a brief chase before he wrecked his car, exited the vehicle reportedly brandishing a knife, and was shot dead by the officers.

PM Stephen Harper has vowed to strengthen the nation's anti-terrorism laws, and has said Canada will not be intimidated by such violence, nor swayed from its role fighting IS in Iraq alongside the US military.

He is now under 24-hour protection, authorities have said.

The gunman

Image copyright Other

Named as 32-year-old Michael Zehaf-Bibeau, a petty criminal with a history of convictions for minor drug offences and theft

Officials believe he recently converted to Islam; a friend he met at a mosque described him as unstable

His mother is thought to be an immigration official, his father a Libyan who once ran a cafe in Montreal

The suspect: A trail of petty crime