TORONTO -- A man charged in an alleged al-Qaida-directed plot to attack a Via Rail passenger train suggested in court Wednesday that he doesn't recognize the authority of the Criminal Code because it is "not a holy book."

Chiheb Esseghaier, 30, of Montreal, asked to address the Toronto courtroom after the five terrorism charges against him were read out.

They are based on the Criminal Code and "we know that this Criminal Code is not a holy book," Esseghaier said.

"It's just written by set of creations and the creations they're not perfect because only the creator is perfect."

As a result, he said, the "conclusions taken out from these judgments" are unreliable.

The justice of the peace presiding over the case, who had warned him to be careful what he said, ordered Esseghaier detained until his next appearance May 23 via video from a detention centre.

That's the same day his co-accused, Raed Jaser, 35, a Toronto resident, is set to appear again in court, also via video.

The pair face several terrorism charges each in what the RCMP is calling the first known alleged plot in Canada directed by al-Qaida.

Esseghaier, a 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.

Esseghaier initially appeared in court Tuesday in Montreal, but was flown back Wednesday to Toronto to appear, as the eventual trial will take place there.

Both men were remanded into custody following their initial appearances in Toronto, and if they want to apply for bail they must do so at a different level of court.

Muhammad Robert Heft, a Muslim community leader who provides de-radicalization counselling to youth, said he met Jaser's father, Mohammad Jaser, when he was renting Heft's basement apartment in 2009.

"He came to me two or three times between 2010-2011 just saying his son was a little overzealous and coming across a little bit too rigid or self-righteous and wanted him to tone it down a bit," Heft told The Canadian Press.

He never got an opportunity to talk to Raed Jaser.

Heft, who also runs an organization that provides outreach to Islamic converts, said he gets such requests from family members, community members and even police officers to talk to certain youth.

"Sometimes they get swept up by these charming people from the Internet and step by step brought into and manipulated into a do-it-yourself version of Islam," he said.

"What we try to do is put doubt in their mind about their understanding being the ultimate understanding."

Heft was appointed by a judge to counsel Steven Chand, one of the members of the so-called Toronto 18 terrorist group. Chand seemed receptive to the counselling while in custody, but Heft said he hasn't heard from him since he was released.

"Rest assured, we're trying our best," Heft said. "We have our idiots like every community and we're working on it."

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 a the UAE embassy in Ottawa said neither of the two men were UAE nationals.

A London-based newspaper reported Wednesday, citing unnamed sources in the Persian Gulf, that Jaser is a Jordanian passport holder with full name Raed Jaser Ibrahim Amouri. The Al Arab report said he had visited the UAE several times and most recently in September 2011.

The newspaper reported that the suspect also visited other Gulf countries including Qatar and Saudi Arabia. It was not possible to independently confirm the report.

Jaser's lawyer, John Norris, has indicated he is preparing a bail application, but as of Esseghaier's court appearance Wednesday he had not retained a lawyer.

Norris has said Jaser, a permanent resident who has been living in Canada for 20 years, "is in a state of shock and disbelief" and denies the allegations against him.

The duo was arrested and charged Monday in an alleged plot that the RCMP said involved "direction and guidance" from al-Qaida members in Iran.

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.

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.