An al-Qaeda-linked plot to derail a VIA Rail passenger train on the New York-to-Toronto route was disrupted by police Monday, when two foreign nationals were arrested following an eight-month counter-terrorism investigation that was aided by members of Canada’s Muslim community.

Chiheb Esseghaier, a 30-year-old Tunisian living in Montreal on a student visa, and Raed Jaser, 35, a Palestinian with landed immigrant status who lives in Toronto, were to appear in a downtown Toronto courtroom Tuesday to face charges of conspiracy to commit murder in association with a terrorist group.

The attackers had allegedly received what police called “direction and guidance” from the core of al-Qaeda, operating out of Iran, where some members of Osama bin Laden’s terrorist group have operated since fleeing Afghanistan. There was no evidence the plot was sponsored by the Iranian regime. The RCMP said the plot was in the planning stages but not imminent.

Canadian authorities allege the suspects Chiheb Esseghaier, 30, and Raed Jaser, 35, had “direction and guidance” from al-Qaida members in Iran, though there were no claims the planned attacks were state-sponsored by Tehran. Esseghaier is believed to be Tunisian and Jaser from the United Arab Emirates.

Some al-Qaida members had been allowed to stay in Iran after fleeing Afghanistan, but were under tight Iranian controls. Relations have been rocky between mainly Shiite Iran and the Sunni-led al-Qaida on many fronts for years.

Iran was a strong opponent of the Taliban, which sheltered Osama bin Laden and others before the U.S.-led invasion after the Sept. 11, 2001, attacks. Many al-Qaida leaders also view Shiite Muslims with suspicion and hostility.

Iran’s Foreign Ministry spokesman Ramin Mehmanparast told reporters that there is “no firm evidence” of any Iranian involvement and groups such as al-Qaida have “no compatibility with Iran in both political and ideological fields.”

“We oppose any terrorist and violent action that would jeopardize lives of innocent people,” said Mehmanparast.

He called the Canadian claims part of hostile policies against Tehran, and accused Canada of indirectly aiding al-Qaida by joining Western support for Syrian rebels. Some Islamic militant factions, claiming allegiance to al-Qaida, have joined forces seeking to topple the regime of Bashar Assad, one of Iran’s main allies in the region.

“The same (al-Qaeda) current is killing people in Syria while enjoying Canada’s support,” said Mehmanparast.

In a separate comment, Iranian Foreign Minister Ali Akbar Salehi called the claim by Canadian authorities “the most ridiculous fake words.”

“I hope Canadian officials resort to more wisdom,” he said.

The two countries have no diplomatic relations after Canada unilaterally closed its embassy in Tehran in 2012 and expelled Iranian diplomats from Ottawa.

On Monday, Alireza Miryousefi, spokesman for the Iranian mission to the United Nations, said the terrorist network was not operating in Iran.

“Iran’s position against this group is very clear and well known. (Al-Qaida) has no possibility to do any activity inside Iran or conduct any operation abroad from Iran’s territory,” Miryousefi said in a statement emailed to The Associated Press. “We reject strongly and categorically any connection to this story.”