Thousands of mourners in Canada have lined the streets of the city of Hamilton, for the funeral of the soldier killed last week in the attack on the Canadian parliament and the war memorial in Ottawa.

Corporal Nathan Cirillo, 24, was one of two soldiers killed in a pair of attacks last week that police said were carried out independently by radical recent converts to Islam.

Cirillo was standing guard at the tomb of the unknown soldier on Ottawa's Parliament Hill when he was shot dead by Michael Zehaf Bibeau.

The assaults took place as Canada's military was stepping up its involvement in air strikes against Islamic State militants in Iraq.

Canadian prime minister Stephen Harper told mourners at the church that Cirillo had inspired and united Canadians.

He choked back tears in a rare public display of emotion when addressing Cirillo's five-year-old son.

"May time ease the searing pain of today," Mr Harper said.

"And may his son, young Marcus Daniel Cirillo, some day find comfort in the fact that our entire country looks up to his dad with pride, with gratitude, with deep abiding respect."

Major the Reverend Canon Rob Fead opened the ceremony calling Cirillo "Canada's son".

Cirillo's cousin, Jenny Holland, and Lieutenant Colonel Lawrence Hatfield, who had been his commanding officer, also spoke.

"Loyal, tough, loving, true," Lt Col Hatfield said. "His family knew it, his regiment knew, and now Canadians know it."

Dressed in ceremonial kilts, white boots and garters, members of Cirillo's Argyll and Sutherland Highlanders unit took a prominent place in the ceremony.

They marched alongside his flag-draped casket through the streets of Hamilton and then carried it into the 138-year-old gothic Christ's Church Anglican Cathedral.

The killings shook Canadians and prompted a debate on how the nation's open culture, and particularly the low-key security in its capital city of Ottawa, may need to change.

Security services have warned that citizens who adopt extremist views and take up arms against the state pose a "serious" threat.

Cirillo was standing on unarmed, ceremonial watch at the nation's war memorial in Ottawa on October 22 when he was shot dead by a man described as troubled and drug addicted.

His attacker then charged into the Parliament building and exchanged fire with security officers not far from a room where Mr Harper was meeting with fellow MPs.

Cirillo's is the first of two funerals for soldiers slain on Canadian soil, to be followed by a service on Saturday in Longueuil, Quebec, for Patrice Vincent.

Warrant officer Vincent, 53, was killed on October 20 near Montreal when a man ran over him and a fellow soldier with his car.

Public mourning for Cirillo began on Friday when thousands of Canadians lined roadways, including the "Highway of Heroes", to view the motorcade that carried his body on the 500 kilometre journey from Ottawa along Lake Ontario to Hamilton, a city west of Toronto.

He was buried in the Field of Honor at Woodland Cemetery in Hamilton.

Kerry pledges to unite against terror threat

The Royal Canadian Mounted Police (RCMP) said Cirillo's killer made a video of himself before his attack, saying he was motivated by his opposition to Canadian foreign policy.

The RCMP said the video also showed he had religious motives.

Officials have also described Vincent's killer, Martin Rouleau, 25, as a man motivated by radical beliefs.

Both attackers were shot dead by security services.

US secretary of state John Kerry, who travelled to Ottawa to express his condolences, laid a wreath at the Ottawa memorial where Cirillo was killed, before meeting with Canadian foreign affairs minister John Baird.

At a press conference, Mr Kerry said the attack was clearly a terrorist attack.

"President Obama, the State Department and our entire administration pledge to work even more closely with your leaders at every level in order to deter and prevent terrorist attacks," he said.

Reuters