Fahim Ahmad, the leader of the so-called Toronto 18, has been sentenced to 16 years in prison for his role in plotting to carry out terrorist attacks in Toronto.

Justice Fletcher Dawson awarded Ahmad credit of 8.5 years for time served, meaning he will be eligible for parole in 3.5 years.

Last May, Ahmad changed his plea to guilty from not guilty on charges of participating in a terrorist group, supplying it with imported firearms and instructing his co-accused to carry out an activity for the group.

During his trial the court heard that the 26-year-old was the kingpin of a terror cell who organized two training camps to gauge the abilities of the cell's other members.

"He was one of the leaders of a terrorist group, and one of the organizers of a training camp held in December 2006," the Public Prosecution Service of Canada wrote in a statement following Ahmad's sentencing. "He intended to attack Parliament and various targets in Toronto.

One recording played in court captured Ahmad saying the group should go to Parliament to "cut off some heads" and "kill everybody."

The Crown argued that Ahmad had plotted to attack Parliament, electrical grids and nuclear power stations, and sought 18 years to life in prison. The defence asked for a 12-year jail sentence.

Ahmad was expressionless when the sentence was handed down but later turned around and smiled to supporters in the courtroom.

When handing down the sentence, Dawson said he took into account Ahmad's lack of a criminal record and his.

He noted that Ahmad wrote letters to his wife while imprisoned, telling her he met people of other religions and was growing more tolerant.

"I am not dealing with someone who remains openly defiant," Dawson said.

"Perhaps I'm only optimistic, but I see prospects of rehabilitation."

Dawson said he hoped Ahmad was serious about becoming less extreme in his views.

"Show me that I wasn't wrong in my assessment," the judge said.

The case received media attention around the world when the suspects were arrested in 2006.

Of 18 people charged in the terrorism case, seven had their charges either dropped or stayed. Another four were found guilty. Seven others pleaded guilty.

Ahmad is among the last of the "Toronto 18" to be sentenced. Two more will be sentenced in November.

With files from The Canadian Press