Two men charged in an alleged al-Qaida supported terror plot to attack a Via Rail passenger train disputed the allegations against them Tuesday as they made their first appearances in court.

Raed Jaser, 35, and Chiheb Esseghaier, 30, are facing several terrorism charges each in what the RCMP is calling the first known alleged plot in Canada directed by the terrorist organization.

Esseghaier, who appeared in court in Montreal, stood calmly in the witness box and asked to address the court.

"The conclusions were made based on facts and words which are only appearances," he said.

The judge, Pierre Labelle, explained that it wasn't the right venue for his remarks.

The PhD student doing doctoral research on nanosensors is facing five charges, including instructing someone to carry out an activity for the benefit of a terrorist group.

Both he and Jaser are charged with conspiracy to murder for the benefit of a terrorist group, participating in a terrorist group and conspiring to interfere with transportation facilities for the benefit of a terrorist group. Esseghaier faces an additional count of participating in a terrorist group.

If convicted, they could be sentenced to life in prison.

Jaser's lawyer said outside court in Toronto that his client "is in a state of shock and disbelief."

"He denies the allegations and he will vigorously defend them," John Norris said. "Mr. Jaser is presumed innocent of these charges, just as any other person who would be facing such a charge is to be presumed innocent."

Several family members attended Jaser's brief court appearance. His father, Mohammed Jaser, was reluctant to answer any questions as he left the courthouse.

"Of course I am supporting my son, of course," he said as about two dozen journalists surrounded him. "Let the police do their job."

Jaser and Esseghaier were arrested and charged Monday in an alleged plot that the RCMP said involved "direction and guidance" from al-Qaida members in Iran. The accused had the capacity to carry out an attack, but there was no "imminent threat" to the public, the RCMP said.

There was no reason to think the planned attacks were state-sponsored by Iran, police added.

Tehran denied any links with an alleged plot and said the terrorist network had no presence in Iran.

The country's foreign ministry spokesman Ramin Mehmanparast told reporters on Tuesday that groups such as al-Qaida have "no compatibility with Iran in both political and ideological fields."

He called the Canadian claims part of Ottawa's hostile policies against Tehran.

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

The wording of the charges against the two suspects suggests the RCMP believes the alleged plot was being hatched largely between April 1 and Sept. 25, 2012. The most recent allegations — Esseghaier's additional charge of participating in a terrorist group — are listed as ending two months ago, on Feb. 14.

Jaser's lawyer questioned the timing of the arrests, calling it "a bit of a mystery."

"They've been very clear that there was no risk to public safety and it's surprising to say the least that this arrest would be made now, close on the heels of the events in Boston and timed perfectly with what was happening in the House of Commons yesterday," Norris said outside court.

"I don't know what their purposes were but the timing is notable."

The House of Commons debated Monday a piece of legislation that would give police more powers in the event of terrorist attacks. Among other things, it creates a new criminal offence that would apply to people leaving Canada for the purpose of committing certain terrorist acts abroad.

Prime Minister Harper congratulated the RCMP, CSIS and local police forces for thwarting the alleged plot and said terrorist threats "unfortunately" are a part of the global reality.

"Our government is committed to working with our police and security agencies to ensure we do everything we can to keep Canada safe," he said Tuesday in the House of Commons.

The nationalities of the two suspects have not been made public by Canadian authorities. Muslim community leaders who were briefed by the RCMP on the arrests were told one is Tunisian and one is from the United Arab Emirates.

But the United Arab Emirates embassy in Ottawa said in a statement Tuesday that neither of the two men were UAE nationals.

Jaser is a permanent resident who has been in Canada for 20 years, Norris said.

Esseghaier was doing a doctorate at the Institut national de la recherche scientifique in Varennes, Que., near Montreal. He started his work in 2010 and was in the editing stage of his thesis on nanosensors that he was scheduled to complete in the fall of 2014, said spokeswoman Julie Martineau.

Two U.S. law enforcement officials told The Associated Press that the target of the alleged attack was a train that runs between New York City and Canada.

Via Rail and Amtrak jointly operate routes between the U.S. and Canada, including the Maple Leaf trains from New York City to Toronto. Both companies have said they are co-operating with law enforcement authorities.

New York City Mayor Michael Bloomberg said Tuesday Canada has kept N.Y. authorities posted on the investigation, but declined to discuss details.

Both suspects in the Via Rail investigation were remanded in custody Tuesday at least until the next procedural steps in their cases.

Esseghaier, who appeared in court wearing the same blue-and-black heavy jacket in which he was photographed Monday, refused the help of a court-appointed attorney.

He was arrested without incident Monday afternoon at a McDonald's in the train station in Montreal. He was then flown to Toronto, but was flown back to Montreal by the RCMP early Tuesday because of jurisdictional issues.

"A person arrested without a warrant, in a province other than ... where the offence took place, must appear within 24 hours before the court in the jurisdiction where he was arrested," federal Crown prosecutor Richard Roy said after the hearing.

Esseghaier is expected to appear Wednesday in court in Toronto, where his trial will also take place.

Jaser, bearded and wearing a Muslim prayer cap, appeared briefly in provincial court in Toronto. He was remanded in custody until May 23 when he is set to appear via video from a detention centre. In the meantime, his lawyer will be making an application for bail in Ontario Superior Court.

— With files from Pierre St-Arnaud in Varennes, Que., and Stephanie Levitz in Ottawa.

Related on HuffPost:

Loading Slideshow...
  • Chiheb Esseghaier

    Chiheb Esseghaier, one of two suspects accused of plotting with al-Qaeda in Iran to derail a train in Canada, arrives at Buttonville Airport just north of Toronto, on Tuesday, April 23, 2013. Canadian investigators say Raed Jaser, 35, and his suspected accomplice Esseghaier, 30, received "directions and guidance" from members of al-Qaeda in Iran. In a brief court appearance in Montreal Tuesday, Esseghaier declined to be represented by a court-appointed lawyer. He made a brief statement in French in which he called the allegations against him unfair.

  • John Norris, the attorney for accused Raed Jaser scrums with the media at Toronto's Old City Hall court house.

  • Chiheb Esseghaier

    In this courtroom sketch, Chiheb Esseghaier appears in court in Montreal on Tuesday, April 23, 2013. Esseghaier, 30, and Raed Jaser, 35, were arrested and charged Monday in what the RCMP said was the first known al-Qaeda terror plot in Canada.

  • Family members of Raed Jaser leave court in Toronto on Tuesday, April 23, 2013. Jaser, a man accused with another man of plotting to derail a train in Canada with support from al-Qaida elements in Iran made a brief court appearance and was told to appear in court again next month.

  • Chiheb Esseghaier

    Chiheb Esseghaier, one of two suspects accused of plotting with al-Qaida in Iran to derail a train in Canada, arrives at Buttonville Airport just north of Toronto, on Tuesday, April 23, 2013. Canadian investigators say Raed Jaser, 35, and his suspected accomplice Esseghaier, 30, received "directions and guidance" from members of al-Qaida in Iran. In a brief court appearance in Montreal Tuesday, Esseghaier declined to be represented by a court-appointed lawyer. He made a brief statement in French in which he called the allegations against him unfair.

  • Chiheb Esseghaier

    Chiheb Esseghaier, one of two men accused of plotting a terror attack on rail target, is led off a plane by an Royal Canadian Mounted Police (RCMP) officer at Buttonville Airport just north of Toronto on Tuesday April 23, 2013. Canadian investigators say Raed Jaser, 35, and his suspected accomplice Esseghaier, 30, received "directions and guidance" from members of al-Qaeda in Iran. In a brief court appearance in Montreal Tuesday, Esseghaier declined to be represented by a court-appointed lawyer. He made a brief statement in French in which he called the allegations against him unfair.

  • Chiheb Esseghaier is taken off an airplane at Buttonville Airport in Markham, Ont. on Monday April 22, 2013.

  • John Norris, the lawyer for Raed Jaser, one of the two men accused of plotting a terror attack on a Canadian rail target, leaves court in Toronto on Tuesday, April 23, 2013. Jaser, 35, was charged in Toronto Tuesday in an alleged al-Qaeda supported terror plot to attack a Via passenger train. His suspected accomplice Chiheb Esseghaier, 30, was charged in Montreal.

  • Mohammed Jaser, father of Raed Jaser, leaves court in Toronto on Tuesday, April 23, 2013. Raed Jaser is accused with another man of plotting to derail a train in Canada with support from al-Qaeda elements in Iran. Raed Jaser had a brief court appearance and was told to appear in court again next month.

  • Security officials check a man at a courthouse in Montreal on Tuesday, April 23, 2013. Reed Jaser, one of two men accused of plotting a terrorist attack against a Canadian passenger train with support from al-Qaida elements in Iran, made a brief court appearance Tuesday but did not enter a plea. Canadian investigators say Jaser, 35, and his suspected accomplice Chiheb Esseghaier, 30, received “directions and guidance” from members of al-Qaida. The case prompted an immediate response from Iran, which denied any involvement and said groups such as al-Qaida do not share Iran’s ideology.

  • Security officials check a man at a courthouse in Montreal on Tuesday, April 23, 2013. Reed Jaser, one of two men accused of plotting a terrorist attack against a Canadian passenger train with support from al-Qaeda elements in Iran, made a brief court appearance Tuesday but did not enter a plea. Canadian investigators say Jaser, 35, and his suspected accomplice Chiheb Esseghaier, 30, received “directions and guidance” from members of al-Qaeda . The case prompted an immediate response from Iran, which denied any involvement and said groups such as al-Qaeda do not share Iran’'s ideology.

  • An RCMP officer shakes hands to what appears to be pilots after a transfer of a terror suspect at Buttonville Airport, April 22, 2013.

  • A Royal Canadian Mounted Police officer pats a colleague on the back before a press conference in Toronto as the RCMP announce the arrest of two men accused of plotting a terror attack on rail target on Monday April 22, 2013.

  • RCMP officers stand outside the Toronto home of one of the two men accused of plotting a terror attack on a rail target, on Monday April 22, 2013.

  • Officers from various law enforcement agencies including the Royal Canadian Mounted Police, Peel Regional Police, and Surete du Quebec gather at a press conference in Toronto, Monday, April 22, 2013 as the RCMP announce the arrest of two men accused of plotting a terror attack on rail target on Monday April 22, 2013.

  • Officers from various law enforcement agencies including the Royal Canadian Mounted Police, Peel Regional Police, and Surete du Quebec gather at a news conference in Toronto on Monday, April 22, 2013, as the Royal Canadian Mounted Police announce the arrest of two men accused of plotting a terror attack on a rail target.

  • Royal Canadian Mounted Police Sgt. Laporte walks with Mohammad Shaied Sheikh of the Masjid el Noor Mosque before attending a news conference in Toronto, Monday, April 22, 2013, as the Royal Canadian Mounted Police announce the arrest of two men accused of plotting a terror attack on rail target.

  • Representatives of Toronto's Islamic community attend a news conference in Toronto as the Royal Canadian Mounted Police announce the arrest of two men accused of plotting a terror attack on rail target, in Toronto, Monday April 22, 2013.

  • MORE: Twitter Reacts To Alleged Canadian Terror Plot