One of two men accused of an al-Qaeda-directed plot to derail a Via Rail passenger train appeared to question the authority of a Toronto court on Wednesday, saying that the Criminal Code should not apply to him because it's "not a holy book."

Chiheb Esseghaier, 30, of Montreal, asked to address the court and was warned to be careful with what he said because it could be used in future appearances.

"All of those conclusions was taken out based on Criminal Code and all of us we know that this Criminal Code is not a holy book," Esseghaier said. "It's just written by a set of creations and the creations they're not perfect because only the Creator is perfect.

"We cannot rely on the conclusions taken out from these judgments."

The judge thanked him for his comment but told him to "save that for another court."

Esseghaier, who the Tunisian Embassy in Ottawa confirmed Wednesday is from that North African country, was represented by duty counsel but said he did not want a lawyer and would like to represent himself.

He was charged with five offences including conspiracy to commit murder for the benefit of a terrorist group, conspiracy to interfere with transportation facilities for the benefit of a terrorist group, and participation in a terrorist group.

The judge ordered Esseghaier remanded into custody until his next appearance on May 23, the same day his co-accused, 35-year-old Raed Jaser, is scheduled to be back in court.

Esseghaier was also told not to communicate with Jaser.

Member of al-Qaeda allegedly involved in plot

Esseghaier appeared briefly in court on Tuesday in Montreal, where prosecutors asked that the case be moved to Ontario. Esseghaier declined a court-appointed lawyer and called the allegations against him unfair during a brief statement.

He was flown to Buttonville airport near Toronto shortly after the appearance.

Jaser was remanded into custody following an appearance Tuesday in a Toronto courtroom. A judge issued a publication ban on the proceedings.

"We are waiting for the disclosure and we will be defending against the charges," Jaser's lawyer, John Norris, said in a telephone interview on Wednesday.

Norris declined to comment when asked if he wanted his client's case separated from Esseghaier, who has spoken out twice in court despite being advised not to.

Norris spoke to the media outside the courthouse on Tuesday, saying his client was in a state of "shock and disbelief."

"He's anxious to see the evidence that the Crown says it has against him," he told reporters.

Norris has questioned the timing of the arrests, pointing to debates in the Canadian Parliament over a new anti-terrorism law that would expand the powers of police and intelligence agencies. MPs voted in favour of the bill Wednesday night, passing it 183 to 93.

Norris refused to say where his client was from, but noted Jaser was a permanent resident of Canada who has lived here for 20 years. He had previously said it was "regrettable" that police chose to make an issue of citizenship, saying it "seems intended to demonize" his client.

The two could be sentenced to life in prison if convicted.

Watched for almost a year

CBC News has learned that RCMP had been following Esseghaier since May 2012. At that time, two undercover surveillance officers watched him on an Air Canada flight to Cancun, where he was to attend a biomedical conference.

Esseghaier's behaviour on the plane was "bizarre," and he had an altercation with a female flight attendant after he went to the washroom, sources say.

As well, sources told CBC News that the arrests of Esseghaier and Jaser were made because the behaviour of one of the suspects had become increasingly unpredictable, although which one isn't known.

CBC News has also learned that a member of al-Qaeda living in Iran, on the border with Afghanistan, was guiding and motivating the alleged suspects.

Broader network under surveillance

Meanwhile, police and intelligence agencies have been monitoring a broader network of terrorism suspects beyond the two men accused of plotting to derail a Via Rail passenger train.

Canadian and U.S. law enforcement have been co-operating on surveillance of suspects on both sides of the border for some time.

CBC News has also learned this broader network has been under surveillance for many months — authorities also monitored their travel within North America — and Canadian authorities became more concerned after they received a tip about some men who were examining railway tracks in Ontario.

'A little too rigid'

People who knew each man said their behaviour had changed in recent years.

Muhammad Robert Heft, president of the P4E Support Group Inc., a non-profit organization that provides support to Muslims in Canada, said Jaser's father, Mohammad Jaser, came to him several years ago because he was worried about his son.

"The father had come to me back in 2010, maybe early 2011, two to three times, and he was concerned his son was becoming a little too rigid in his understanding of the religion and thought I could talk to him," Heft said.

However, Heft said the father was busy taking care of another son who had been injured and never arranged a meeting.

Yusuf Bakhit often prayed with Jaser, and said Jaser took him in last winter, when he had nowhere else to go.

"He just wants to be a good Muslim, he doesn't want to be a bad guy, to hurt innocent people, he's not like that," Bakhit said. He said when he was living with Jaser, he never saw "signs of anything to do with terrorism."

Tufik Elalj, who was also a fellow student of Esseghaier at the University of Sherbrooke in Quebec, said the suspect didn't seem to know a lot about Islam in 2008. Elalj told CBC News he lost contact with him in 2011, and when he saw him again in 2012 his behaviour had changed.

The RCMP have said the two suspects watched trains and railways in the Greater Toronto Area to "initiate a terrorist attack."

There was a specific route targeted, not necessarily a specific train, police said, although they have declined to reveal the route. Police said the attack was not imminent.

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.