In this courtroom sketch, Raed Jaser appears in court in Toronto on Tuesday. Jaser, 35, and Chehib Esseghaier, 30, were arrested and charged Monday in what the RCMP said was the first known al-Qaida terror plot in Canada. (ASSOCIATED PRESS / The Canadian Press, John Mantha)

TORONTO (AP) — A man accused of plotting with al-Qaida members in Iran to derail a train in Canada rejected the charges and said Tuesday that authorities were basing their conclusions on appearances. Law enforcement officials in the U.S. said the target was a train that runs between New York City and Canada.

Canadian investigators say Raed Jaser, 35, and his suspected accomplice Chiheb Esseghaier, 30, received guidance — but no money — from members of al-Qaida in Iran. Iran released a statement saying it had nothing to do with the plot, even though there were no claims in Canada that the attacks were sponsored directly by Iran.

But the case raised questions about the extent of Shiite-led Iran’s relationship with the predominantly Sunni Arab terrorist network. It also renewed attention on Iran’s complicated history with the terror group, which ranges from outright hostility to alliances of convenience and even overtures by Tehran to assist Washington after the Sept. 11, 2001, attacks on the United States.

Charges against the two men in Canada include conspiring to carry out an attack and murder people in association with a terrorist group. Police — tipped off by an imam worried by the behavior of one of the suspects — said it was the first known attack planned by al-Qaida in Canada.

Law officials in New York with knowledge of the investigation told The Associated Press the attack was to take place on the Canadian side of the border. They are not authorized to discuss the investigation and spoke only on condition of anonymity.

Amtrak and Via Rail Canada jointly operate routes between the United States and Canada, including the Maple Leaf from New York City to Toronto.

Mayor Michael Bloomberg said Canada has kept New York posted on the investigation.

“I can just tell you that you are probably safer in New York City than you are in any other big city,” Bloomberg told reporters Tuesday without discussing details.

In a brief court appearance in Montreal, a bearded 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.

“The conclusions were made based on facts and words which are only appearances,” he said in a calm voice after asking permission to speak.

Jaser appeared in court earlier Tuesday in Toronto and also did not enter a plea. He was given a new court date of May 23. He had a long beard, wore a black shirt with no tie, and was accompanied by his parents and brother. The court granted a request by his lawyer, John Norris, for a publication ban on future evidence and testimony.

Norris questioned the timing of the arrests, pointing to ongoing debates in the Canadian Parliament over a new anti-terrorism law that would expand the powers of police and intelligence agencies.

He said his client would “defend himself vigorously” against the accusations, and noted Jaser was a permanent resident of Canada who has lived there for 20 years. Norris refused to say where Jaser was from, saying that revealing his nationality in the current climate amounted to demonizing him.

Canadian police also declined to release the men’s nationalities, saying only they had been in Canada a “significant amount of time.”

Muslim community leaders who were briefed by the RCMP ahead of Monday’s announcement of the arrest said they were told one of the suspects is Tunisian and the other from the United Arab Emirates.

Esseghaier’s LinkedIn profile lists him as having studied in Tunisia before moving to Canada, where he was pursuing a PhD in nanotechnology at the National Institute of Scientific Research, a spokeswoman at the training university confirmed.

In Abu Dhabi, a UAE source informed about the attack plot said there was “no UAE citizen” with the name Raed Jaser. The source spoke on condition of anonymity because he was not authorized to brief media.

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. Canadian police said the men never got close to carrying out the attack.

The warning first came from an imam in Toronto, who in turn was tipped off by suspicious behavior on the part of one of the suspect.

“I was involved in alerting police about the suspect. I made some calls on behalf of the imam over a year ago,” Toronto lawyer Naseer Syed said. He would not say what, exactly made the imam suspicious.

“The Muslim community has been cooperating with authorities for a number of years and people do the right thing when there is reason to alert authorities,” Syed said, adding that he was speaking for the imam, who wished to remain anonymous.