The investigation surrounding the planned attack was part of a cross-border operation involving Canadian law enforcement agencies, the FBI and the U.S. Department of Homeland Security.
The attack "was definitely in the planning stage but not imminent," RCMP chief superintendent Jennifer Strachan said Monday. "We are alleging that these two individuals took steps and conducted activities to initiate a terrorist attack. They watched trains and railways."
Strachan said they were targeting a route, but did not say whether it was a cross border route. Best said the duo had been under investigation since last fall. Their bail hearing was scheduled in Toronto on Tuesday.
Charges against the two men include conspiring to carry out an attack and murder people in association with a terrorist group. Police said the men are not Canadian citizens, said they had been in Canada a "significant amount of time," and declined to say where they were from or why they were in the country.
Muhammad Robert Heft, who runs an outreach organization for Islamic converts, and Hussein Hamdani, a lawyer and longtime advocate in the Muslim community, said one of the suspects is Tunisian and the other is from the United Arab Emirates. Both were part of a group of Muslim community leaders who were briefed by the RCMP ahead of Monday's announcement.
Authorities were tipped off by members of the community of one of the suspects, Best said, without expanding.
A spokeswoman for the University of Sherbrooke near Montreal said Esseghaier studied there in 2008-2009. More recently, he has been doing doctoral research at the Institut national de la recherche scientifique, a spokeswoman at the training university confirmed.
A LinkedIn page showing a man with Esseghaier's name and academic background helped author a number of biology research papers, including on HIV and cancer detection. The page carries a photo of a black flag inscribed with the Islamic declaration of faith.
The arrests just a few months after two Canadians were discovered among militants killed in a terrorist siege at a gas plant in Algeria. The siege killed at least 38 hostages and 29 militants, including Ali Medlej and Xristos Katsiroubas, two high school friends from London, Ontario.
In 2006 Canadian police foiled the so-called Toronto 18 home grown plot to set off bombs outside Toronto's Stock Exchange, a building housing Canada's spy agency and a military base. The goal was to scare Canada into removing its troops from Afghanistan. The arrests made international headlines and heightened fears in a country where many people thought they were relatively immune from terrorist strikes.