Chiheb Esseghaier, 30, and Raed Jaser, 35, were allegedly planning to carry out an attack on a Via Rail passenger train, the Royal Canadian Mounted Police (RCMP) told a news conference. A bail hearing was set for Tuesday.

Charges filed against the two include conspiring to carry out an attack and conspiring with a terrorist group to murder persons, though very few details about the plot were revealed.

Assistant RCMP Commissioner James Malizia told reporters the suspects "were receiving support from Al-Qaeda elements located in Iran" but added: "There's no indication that these attacks were state-sponsored."

When asked to describe the kind of support offered, he replied: "Direction and guidance."

Malizia said the suspects are "not Canadian citizens" but declined to reveal their nationalities. One of the two men lived in Montreal for several years, he added, without saying which one.

The suspects' plans were "not based on their ethnic origins but on an ideology," police said.

RCMP Chief Superintendent Jennifer Strachan said the duo -- who had been under surveillance since last August -- planned "to derail a passenger train" in the Toronto area, though she would not specify which route.

"We are alleging these individuals took steps and conducted activities to initiate a terrorist attack. They watched trains and railways in the Greater Toronto area," Strachan added.

However, police emphasized that an attack had not been imminent.

"While the RCMP believed that these individuals had the capacity and intent to carry out these criminal acts, there was no imminent threat to the general public, rail employees, train passengers or infrastructure," said an RCMP statement.

The arrests come one week after the twin bombings at the Boston Marathon killed three people and wounded 200, and as Canada's parliament debates a proposal to beef up anti-terror laws, including criminalizing the travel of Canadians abroad in order to participate in an attack.

It appeared there was no link between the Boston bombings and the alleged train plot.

The US Federal Bureau of Investigation was involved in the Canadian investigation, though the extent of the information-sharing was not immediately clear.

A spokesman for the US embassy in Ottawa said the arrest resulted from "extensive cross-border cooperation."

Toews also said the success of the anti-terror operation dubbed "Smooth" was "due to the fact that Canada works very closely with international partners to combat terrorism."

Details about the supposed identities began to emerge in local media.

The National Post reported that Esseghaier was born in Tunisia and identified Jaser as a Palestinian with United Arab Emirates citizenship who has Canadian permanent resident status.

On Esseghaier's LinkedIn profile, whose authenticity Radio-Canada said it had been able to verify, the 30-year-old presented himself as a Tunisian engineer who was a PhD student at Quebec's INRS University since November 2010.