“There were times when I could feel there was a loner not fitting into the community,” the imam said, but no one who fit the description of the two men.

The Canadian Broadcasting Corporation and other Canadian news outlets reported that the two men had been known to the Canadian Security Intelligence Service and that its agents questioned people in London in mid-2012 about Mr. Katsiroubas in particular.

No one answered the doors of homes belonging to members of Mr. Katsiroubas’s family on Tuesday.

Teachers and officials at the high school would not comment about the former students. While several former classmates recalled Mr. Katsiroubas, Mr. Medlej seemed less familiar.

Several other young Canadians have been involved in radical political acts. An American military tribunal convicted Omar Khadr, who was born in Toronto, of killing an American soldier in a battle in Afghanistan in 2002, when he was 15. In September, he was sent to a Canadian prison from the American military prison in Guantánamo Bay, Cuba.

In 2006, the police arrested 18 people in and around Toronto who they said were part of an Al Qaeda-affiliated group that planned a wave of attacks in Canada. The arrests were triggered by the delivery of what the group thought was fertilizer it intended to use in making bombs. Eleven people were convicted on a variety of terrorism-related charges, and charges against seven others were dropped.

In testimony before a Canadian Senate committee last April, the director of the Canadian Security Intelligence Service, Richard B. Fadden, said his agency believed that 45 to 60 Canadians had traveled, or tried to travel, to several countries to “join Al Qaeda-affiliated organizations and engage in terrorism-related activities.” He offered few other details.

On its Web site, the intelligence service says that “with the exception of the United States, there are more terrorist groups active in Canada today than in any other country in the world.” Those groups, according to the agency, are attracted to Canada because of its proximity to the United States and mainly engage in support activities, including recruiting, for actions elsewhere.