Iran has denied any links to two men arrested in Canada on suspicion of planning a terrorist attack on a train.
Canadian officials said an attack had been planned with support from al-Qaeda elements in Iran, although there was no evidence of state sponsorship.
Chiheb Esseghaier, 30, and Raed Jaser, 35, are due to appear in court on Tuesday for a bail hearing.
Iranian Foreign Minister Ali Akbar Salehi said to suggest a link between al-Qaeda and Iran was "ridiculous".
"This is the most hilarious thing I've heard in my 64 years," Salehi told the Iranian Isna news agency.
"It is really ridiculous to link al-Qaeda to Iran. I hope that the Canadian authorities think a bit more rationally and pay attention to the consciousness of the people and world public opinion."
Al-Qaeda – a militant Salafist Islamic movement – preaches a radical anti-Shia ideology that places it firmly at odds with Shia Iran.
However, analysts say that despite this enmity al-Qaeda and Iran have tolerated one another where it suited them.
Last September Canada severed diplomatic ties with Iran, closing its embassy in Tehran and expelling all remaining Iranian diplomats from Canada.
At the time Foreign Minister John Baird said Canada viewed Iran "as the most significant threat to global peace and security in the world today".
Canadian authorities said the two suspects were arrested in Montreal and Toronto on Monday.
They had allegedly planned to derail a passenger train in the greater Toronto area, but it is not clear when.
The Royal Canadian Mounted Police (RCMP) said the surveillance operation leading to the arrests was "a result of extensive collaborative efforts".
It said FBI agents from the US were involved in helping to foil the attack, although a US justice department official said there was no connection between the plot and last week's Boston Marathon bombings.
Assistant Commissioner James Malizia: "Innocent people would have been killed or seriously injured"
The RCMP said the two men, who are not Canadian citizens, had planned to derail a train operated by VIA Rail and "kill and hurt people".
RCMP Chief Superintendent Jennifer Strachan said the attack was "definitely in the planning stage but not imminent".
"We are alleging that these two individuals took steps and conducted activities to initiate a terrorist attack," she said.
"They watched trains and railways in the Greater Toronto area."
Chief Supt Strachan did not say if the route being targeted was a cross-border route with the US.
However, New York Republican Representative Peter King said the attack was intended "to cause significant loss of human life including New Yorkers".
VIA Rail, which operates passenger rail services across Canada, said that "at no time" were passengers or members of the public in imminent danger.
Canadian Public Safety Minister Vic Toews said the arrests showed that terrorism continued to be a real threat to Canada.