OTTAWA -- Peace, order and good government returned to the national capital Thursday with a back-slapping flourish of fortitude and common purpose, but a persistent shadow loomed -- one of unsettling memories and unanswered questions.

An almost triumphal sense of camaraderie in the House of Commons was burdened by mourning for the loss of Cpl. Nathan Cirillo -- the honour guard gunned down at the National War Memorial a day earlier -- and by a sobering reality: Canada's seat of government had been undermined by a lone, mentally unstable homeless man with a rifle.

"It is disheartening and frightening to anyone -- police included -- when a senseless act of violence takes place in Canada," RCMP Commissioner Bob Paulson said at an afternoon news conference.

The many security vulnerabilities exposed by the incident were secondary this day, however, to shock and relief that more lives were not lost.

Kevin Vickers, the sergeant-at-arms of the House of Commons, entered the green-carpeted chamber to thunderous applause -- less than 24 hours after he was credited with helping shoot dead the gunman bent on murderous rampage just down the marbled hall.

Vickers, his mouth a tight line, appeared to blink back tears under a cascade of continuous applause as he carried the ceremonial mace into the House to open the day's proceedings. After more than two long minutes, the tribute ended with MPs thumping their desks.

Security footage made public Thursday reveals the path of gunman Michael Zehaf Bibeau -- a man known to police through a petty criminal record -- as he commandeered a cabinet minister's idling car on Parliament Hill and drove it up to the Centre Block's front doors, RCMP vehicles in hot pursuit.

But what prompted him to shoot Cpl. Cirillo with a Winchester 30-30 lever action rifle and then turn his sites on Parliament Hill remains a mystery.

Zehaf Bibeau had recently come to Ottawa seeking a passport in order to travel to Syria, according to the RCMP, but he was not on any watch list and his passport application had not yet been officially denied.

"We have not come to ground completely for his motivations on this attack," said Paulson. "But clearly it's linked to his radicalization; clearly it's linked to his difficult circumstances."

Paulson also confirmed that Vickers directly engaged the assailant in a gun battle in Parliament's Hall of Honour, each shooting from behind polished marble pillars as other security officials unleashed a hail of gunfire.

The attack took place directly outside the unlocked wooden doors of meeting rooms where Prime Minister Stephen Harper and Opposition Leader Tom Mulcair were addressing their respective caucuses.

Harper holed up in a closet for several minutes while the mayhem continued outside, and some of his Conservative MPs brandished flagpoles as spears expecting an imminent intrusion by armed attackers.

Across the hall, a guard in the NDP meeting room stood spread-eagled across the double doors to the hall. His heroics were fortunately not needed, but a bullet hole in one door showed how close was the call.

In response, Thursday morning's parliamentary sitting had an emotional, almost "triumphant" tenor -- a term used by Justice Minister Peter MacKay.

The 300-plus MPs bursts into a spontaneous rendition of O Canada after Speaker Andrew Scheer blessed the gathering with a prayer for "wisdom, knowledge and understanding."

Amidst the heart-on-sleeve patriotism, however, politicians, police forces and intelligence officials were beginning the cold task of assessing security around Parliament Hill and the safety of the country itself.

Cpl. Cirillo was the second soldier to die in an attack this week. Warrant Officer Patrice Vincent was run down by an attacker with jihadist sympathies on Monday in Saint-Jean-Sur-Richelieu, Que.

The prime minister, as he had the evening before in an address to the country, called the attacks acts of terrorism and linked them to the battle against ISIL, the Islamic State in Iraq and the Levant.

"For now, make no mistake, even as the brave men and women of our Armed Forces are taking this fight to the terrorists on their own territory, we are equally resolved to fight it here," Harper told the House.

"We live in dangerous times, yes, but the mission of our country and the work of this Parliament goes on, and so does the work throughout this city."

Harper's address ended with the extraordinary spectacle of the prime minister walking down the Commons' centre aisle to shake Vickers' hand, then exchange handshakes and back-slapping hugs with both Mulcair and Liberal Leader Justin Trudeau.

Mulcair and Trudeau also spoke of the need for unity and resolve, although they were more circumspect than the prime minister in labelling Wednesday's shootings an act of terror.

Elizabeth May, the leader of the Green party, had a more prosaic take.

"If I were a betting person, and it is good for my bank account that I am not, I would put money on these being the acts of isolated, disturbed and deeply troubled men who were drawn to something crazy," she told the House.

"I do not believe that it was a vast network, or that the country is more at risk today than it was last week."

Whatever the motivations for the attack, changes are coming, said the prime minister.

An effort to toughen up the "surveillance, detention and arrest" powers of the Canadian Security Intelligence Service would be forthcoming in short order, Harper said in the House.

And Paulson said the prime minister will now be under close "24-7" guard by his RCMP security detail.

Scheer, the Commons Speaker, ordered a full review of security in the House of Commons.

In a release, Vickers wrote that "yesterday, during extraordinary circumstances, security personnel demonstrated professionalism and courage. I am grateful and proud to be part of this team."

He also lauded House of Commons Const. Samearn Son, who was shot in the leg during the initial encounter with the gunman at the Centre Block's front doors.

"He is in stable condition and expected to make a full recovery," said Vickers.

Gov.-Gen. David Johnston issued a statement to Canadians from Queen Elizabeth: "Prince Philip and I were shocked and saddened by the events in Ottawa yesterday. Our thoughts and prayers are with all those affected. ELIZABETH R."

Ottawa police said late Thursday that the area around the National War Memorial that was blocked off because of the investigation has reopened to the public, but Parliament Hill remained off limits.

- With files from Andy Blatchford, Joan Bryden, Jennifer Ditchburn, Lee-Anne Goodman and Stephanie Levitz.