Hiva Mohammad Alizadeh, a man police called the ringleader of a group accused of plotting attacks in Canada, has pleaded guilty to explosives possession with the intent to cause harm as part of a terrorist conspiracy and received a 24-year sentence as part of an agreement.

He entered the plea in court in Ottawa on Wednesday under a deal agreed to by Crown and defence lawyers.

Alizadeh received a 24-year sentence, minus time served. Credited one and a half years for each of the four years he served, the sentence means Alizadeh will spend 18 years in a federal prison.

Alizadeh effectively guilty of treason, judge says

Hiva Alizadeh

Hiva Alizadeh, one of three men charged with terrorism-related counts after a 2010 RCMP investigation, pleaded guilty Wednesday in Ottawa to explosives possession with intent to cause harm as part of a terrorist conspiracy. (Sketch by Laurie Foster-MacLeod)

Alizadeh apologized in court, saying that he wanted to be de-radicalized.

Justice Colin McKinnon told Alizadeh in court he was effectively guilty of treason and had betrayed his family and community.

Alizadeh is one of three men arrested and charged in 2010 after an RCMP investigation.

Misbahuddin Ahmed, an Ottawa X-ray technologist, is awaiting sentencing after he was found guilty in July of conspiring to knowingly facilitate a terrorist activity and participating in the activities of a terrorist group.

A third man whose voice was recorded in police surveillance — former London, Ont., pathologist Khurram Sher — was found not guilty in August of planning terrorist activity.

Spent 2 months at terror training camp

An agreed statement of facts submitted with the plea outlined Alizadeh's efforts to create a terrorist group within Canada in the months leading up his arrest.

According to the statement, Alizadeh had gone to a terrorist training camp in Afghanistan in 2009 and spent two months there, receiving training in the use of firearms and how to assemble remote-controlled improvised explosive devices.

He also smuggled back violent propaganda videos, instructional materials on constructing triggering devices and 56 electronic circuit boards designed specifically to remotely detonate improvised explosive devices (IEDs).

He maintained contact with Kurdish insurgents loosely allied with the Taliban and a man who helped foreigners receive terrorist training in Afghanistan and Pakistan and used pay-as-you-go cellphones and payphones, as well as a public library internet account under a false name, to communicate with co-conspirators.

After returning to Canada, Alizadeh sought to start his own group in Ottawa. He met with Ahmed in February 2010 and attempted to radicalize him. In July 2010, the two men also met with Sher and attempted to recruit him.

Police found partially assembled triggering device

When police searched Alizadeh's apartment, they found a President's Choice grocery bag containing a partially assembled circuit board for an IED with seven components soldered on, in keeping with instructions in the accompanying terrorist training material.

Police said the device needed only three more components readily available at consumer electronic stores to be functional when combined with explosives, and classified this as an "explosive substance" under the Criminal Code. They later found the bag and its contents in Ahmed's possession.

Alizadeh was planning move to Saudi Arabia when arrested

Alizadeh also solicited money in Canada to help his brother in Iran buy what he believed would be a rocket-propelled grenade device.

When police arrested Alizadeh and Ahmed in Ottawa, neither had obtained the necessary chemicals or explosives to make the IED functional, and they had no plans for a specific attack, according to the agreed statement of facts.

At the time of the arrests, Alizadeh's wife had accepted a teaching job in Saudi Arabia and the couple were planning to move there with their three children.