Canadian police have foiled an al Qaeda-backed "major terrorist plot" to attack a passenger train on a railway line between New York and Toronto.
Two people have been arrested and charged with conspiring to carry out the attack and murder people in association with a terrorist group, police revealed at a news conference in Toronto.
The suspects - Chiheb Esseghaier, 30, and Raed Jaser, 35 - had been under surveillance since August 2012 after authorities were tipped off about one of the men.
Esseghaier, who opted not to be represented by a court-appointed lawyer as he appeared before a Montreal court, made a brief statement claiming the prosecution based its conclusions on mere appearances.
A bearded Esseghaier stood in handcuffs throughout the hearing, wearing a jacket over a button-down shirt.
He will now be flown back to face charges in Toronto, where suspected accomplice Jaser, earlier made a brief appearance in court.
Charges against the two men include conspiring to carry out an attack and murder people in association with a terrorist group.
Jaser, who sported a long beard, a black shirt with no tie and was accompanied by his parents and brother, was told to appear in court again on May 23.
The court granted a request by his lawyer for a publication ban on future evidence and testimony.
The pair were allegedly planning to target and derail a Via Rail passenger train in the Toronto area, and are alleged to have received "direction and guidance" from al Qaeda "elements" in Iran.
Police said there was "no indication that these attacks were state-sponsored" and declined to say where the suspects were from.
They confirmed they were not Canadian citizens but had been in the country "a significant amount of time".
The suspects' plans were "not based on their ethnic origins but on an ideology," police said.
"This is the first known al Qaeda-planned attack that we've experienced in Canada," Superintendent Doug Best said.
Iran's Foreign Minister Ali Akbar Salehi said the claim that the men were backed by Tehran-supported al Qaeda was "ridiculous".
"This is the most hilarious thing I've heard in my 64 years," he said.
Public Safety Minister Vic Toews warned later that the "arrests demonstrate that terrorism continues to be a real threat to Canada".
Canadian authorities, the FBI and US Homeland Security police and agents have been involved in a year-long cross-border operation that led to the arrests in Toronto and Montreal.
Assistant Commissioner James Maliza, of the Royal Canadian Mounted Police, said: "Had this plot been carried out it would have resulted in innocent people being killed, or seriously injured."
His colleague Chief Superintendent Jennifer Strachan added: "We are alleging that these two individuals took steps and conducted activities to initiate a terrorist attack.
"They watched trains and railways in the Greater Toronto area. It was definitely in the planning stage but not imminent."
Sky's US correspondent Amanda Walker said: "They are really hailing this as a successful operation, something that they have managed to prevent.
"It does seem they have treated this as a very serious and major threat which was certainly well on in the planning.
"But not far enough for the public or railway staff to be in any immediate danger.
"So obviously they had a difficult act here to actually balance the timing of when they made these arrests - getting enough intelligence, enough information, but not taking that up to the point when the public would have been in real danger."
The news comes one week after twin bombings at the Boston Marathon killed three people and wounded 180 - and as Canada's parliament debates a proposal to beef up anti-terror measures.
A US Justice Department official in Washington said there was no connection between the thwarted terrorist plot and last Monday's attacks in Boston.