Three Ontario residents have been charged in what police allege was an internationally-linked terror ring that planned to build homemade bombs on Canadian soil.

The Mounties say the men were arrested after a year-long investigation unveiled evidence that linked them to militant activity in Afghanistan and elsewhere.

Two of the men were arrested on Wednesday after dramatic police raids on two separate residences in a pair of unassuming west-Ottawa neighbourhoods.

Police confirmed a third arrest in the case Thursday as details of the arrests were made public for the first time.

The RCMP say that key evidence seized during the raids include electronic components and circuitry, which is often found in improvised explosive devices.

Two of the suspects -- 30-year-old Hiva Alizadeh and 26-year-old Misbahuddin Ahmed-- appeared in an Ottawa courthouse on Thursday on terror-related offences.

Authorities later confirmed the additional arrest of Khurran Syed Sher, a 28-year-old McGill University medical school graduate who had recently been living in southern Ontario. He is also facing charges related to the alleged terror ring.

Police allege that Alizadeh is the ringleader and a member of a terror group based in Afghanistan. He has also allegedly been trained in building explosives.

Dubbed "Operation Samossa," the RCMP say their investigation found that Alizadeh, Ahmed and Sher "formed part of a terrorist group … and were participating in terrorist activity in relation to that group within Canada."

RCMP Chief Supt. Serge Therriault said that 50 electronic circuit boards were seized, which police say could have been used as remote-control triggers for bombs.

Additionally, police seized "a vast quantity of terrorist literature and instructional material ... showing that the suspects had the intent to construct an explosive device for terrorist purposes."

In a strange twist, Sher appeared on the television show "Canadian Idol" in 2008, dressed in traditional Pakistani attire. He performed Avril Lavinge's song "Complicated" and danced for the judges.

First court appearances

CTV's Roger Smith reported that Alizadeh and Ahmed appeared in court separately and each appeared in court for only a brief time. They were remanded until a court appearance they will make next week.

Alizadeh faces charges of conspiracy, committing an act for terrorism purposes and providing or making available property for terrorism purposes.

Ahmed is facing conspiracy and terrorism-related charges.

Police also say that funds were being raised in Canada and then sent to Afghan militants.

The Crown prosecutor handling the case at this point is David McKercher -- the same lawyer who tried Momin Khawaja, a convicted terrorist also from Ottawa.

Defence lawyer Ian Carter, who is representing Ahmed, said the charges were serious and they could potentially put his client away "for a long time."

Sean May, who is representing Alizadeh, called them "the most serious charges you can face except for a murder charge."

Ottawa arrests

The arrests of the first two suspects accompanied two separate Wednesday raids in west-end Ottawa: one took place at a townhouse, the other occurred at a highrise apartment building.

The RCMP towed away an automobile owned by Ahmed, an X-ray technician who works at The Ottawa Hospital's Civic Campus.

Public Safety Minister Vic Toews said in Ottawa that the arrests underline the threat of domestic terrorism in many nations in the West.

Prime Minister Stephen Harper, who is touring the Arctic, had similar concerns.

"The networks that threaten us are worldwide, they exist not only in remote countries but they have -- through globalization and through the Internet -- they have links through our country and all through the world."

Background work before arrests

The arrests come at a time when several Canadian security officials have warned about the threat of terrorism on Canadian soil.

Last month, CSIS Director Dick Fadden predicted that more homegrown terror arrests would be forthcoming.

"We're monitoring a number of other cases in which we think there may be similar circumstances," Fadden said during a speech to the Commons public safety committee.

Terrorism expert Alan Bell said homegrown terror groups are particularly difficult to identify, because their members are not evident until they begin to "exhibit some types of signs of some type of radicalism."'

"Some of them are married, some of them have excellent pedigrees. They do normal jobs, but on the other hand, it's the dark side of their radicalism that is making them commit these types of acts."

Earlier this summer, the final suspects of the so-called "Toronto 18" were convicted of terror-related charges after police revealed a homegrown terror plot that aimed to attack targets on Canadian soil.

With files from The Canadian Press