Image copyright AP Image caption Zehaf-Bibeau said the attack was "retaliation" for Afghanistan and Iraq

The gunman who shot dead a Canadian soldier and tried to storm parliament last year was protesting against Canada's military role overseas.

In a video newly released by police and made by Michael Zehaf-Bibeau shortly before the attacks, he cites Iraq and Afghanistan.

He said he wanted to show that Canadian soldiers were "not even safe in your own land".

Zehaf-Bibeau was shot dead as he tried to storm parliament.

The video, made on Zehaf-Bibeau's phone, was played to a committee at parliament. Police edited out 18 seconds of the recording.

But it backs up suggestions by Canadian police last year the attacks were ideologically driven.

The BBC's Naomi Grimley says the editing was because investigations are still ongoing to discover whether Zehaf-Bibeau was acting alone or as part of a wider network.

Image copyright Reuters Image caption Video showed the armed suspect running towards parliament

"To those who are involved and listen to this movie, this is in retaliation for Afghanistan and because [Prime Minister Stephen] Harper wants to send his troops to Iraq," Zehaf-Bibeau says in the video.

"Canada's officially become one of our enemies by fighting and bombing us and creating a lot of terror in our countries and killing us and killing our innocents," he adds.

Zehaf-Bibeau, 32, shot dead Corporal Nathan Cirillo outside Ottawa's war memorial in October 2014, before entering parliament and firing dozens of shots.

He was eventually gunned down by the Sergeant-at-arms, Kevin Vickers.

The Canadian-born gunman had been convicted of several petty crimes. Police believe he may have wanted to travel to Syria around the time of the attack.