Image copyright Facebook Image caption Alexandre Bissonnette

A Canadian man who killed worshippers in a Quebec City mosque in 2017 has been sentenced to life in prison.

Alexandre Bissonnette, 29, will be eligible for parole in 40 years.

The prosecution had asked for a total of 150 years behind bars, which would have been the harshest jail penalty ever handed down in Canada.

Justice Francois Huot chose instead to allow for the possibility of parole within Bissonnette's natural life.

While reading his sentencing decision, the Quebec Superior Court judge said that "punishment should not be vengeance".

A first-degree murder conviction in Canada carries an automatic life sentence with no chance of parole for 25 years.

Image copyright AFP Image caption The Islamic Cultural Center of Quebec, where the attack took place on January 29, 2017

On the evening of 29 January, 2017, Bissonnette stormed into the Quebec Islamic Cultural Centre and shot at those gathered for prayers, killing six and seriously injuring five others, including Aymen Derbali, who is now paralysed.

In March, Bissonnette admitted to killing Khaled Belkacemi, 60, Azzedine Soufiane, 57, Abdelkrim Hassane, 41, Mamadou Tanou Barry, 42, Aboubaker Thabti, 44, and Ibrahima Barry, 39, in the January attack.

He also pleaded guilty to six counts of attempted murder, including one count for the 35 people who were present in the mosque at the time of the shooting but who were not injured.

"I am ashamed of what I did," he told a Quebec courtroom at the time. "I am not a terrorist, I am not an Islamophobe."

Justice Huot said Bissonnette's actions in entering the mosque at the end of prayers and shooting congregants was motivated by prejudice. But the judge also noted Bissonnette had mental health issues.

Lawyers for both the defence and the prosecution said they needed time to analyse the judge's lengthy decision amid the possibility of an appeal.

Mr Derbali told journalists at the Quebec City courthouse that many survivors were deeply disappointed with the judge's ruling.

He said the sentence did not fully reflect the severity of the crimes committed.

Media playback is unsupported on your device Media caption Aymen Derbali faces a new life after being paralysed in a 2017 Quebec mosque shooting

In 2011, Canadian law was amended to allow judges to impose consecutive sentences instead of concurrent 10- or 25-year sentences with no parole eligibility, for multiple murders.

Bissonnette's lawyers had argued that if he was sentenced to 25 years consecutively for each murder it would amount to death by incarceration.

Consecutive sentences have been applied a handful of times in Canada since the law was amended, including a judge handing down a 75-year prison sentence for a man who pleaded guilty to killing three police officers in 2014.