Two men accused of plotting to attack a passenger train travelling from New York to Toronto were found guilty of several terror-related charges and could spend the rest of their lives in prison.

Prosecutors had argued during the trial that the men were motivated by Islamic extremism and spent months plotting to kill as many people as they could. Investigators said the men received guidance from members of al-Qaida, in what they called the first known attack planned by the terrorist network in Canada.

Raed Jaser, a Canadian citizen of Palestinian descent, and Tunisian-born Chiheb Esseghaier were arrested in 2013. Jaser, 37, and Esseghaier, 32, had pleaded not guilty.

On Friday, the 10th day of deliberations, the jury found both men guilty of conspiring to commit murder in association with a terrorist group.

Esseghaier appeared unruffled as the Toronto jury found him guilty on all five terrorism charges against him. He calmly repeated that he had not participated in the trial and did not want to take part in sentencing arguments either.

Jaser looked at the ceiling at one point after the jury delivered their verdicts, finding him guilty of three out of the four charges he faced. He then kept his right hand up to his face through the rest of the proceeding, biting his knuckles at one point.

The men, who will be sentenced on 10 April, could face maximum punishment of life in prison.

Outside the courthouse, prosecutor Croft Michaelson called Jaser and Esseghaier “real serious public dangers”, and thanked US authorities for their co-operation in the investigation.

The investigation surrounding the planned attack was part of a cross-border operation involving Canadian law enforcement agencies, the FBI and the US Department of Homeland Security. Canadian police said the men never got close to carrying out the attack.

Train routes between the US and Canada, including the Maple Leaf from New York City to Toronto, are jointly operated by Amtrak and Via Rail Canada.

Law officials in New York with knowledge of the investigation told Associated Press back in 2013 that the attack was to take place on the Canadian side of the border.

Police were originally tipped off by an imam worried by the behaviour of one of the suspects.

Jaser’s lawyer had argued that his client was only feigning interest in the alleged terror plot as part of an elaborate scheme to extract money from his co-defendant and an undercover FBI agent who befriended the men.

Jaser, who was born in the United Arab Emirates to Palestinian parents, was living in Toronto at the time of his arrest.

Esseghaier, who was pursuing a doctorate in Montreal when he was arrested in 2013, chose not to participate in his trial because he had wanted to be judged by the rules of the Qur’an.

He did not cross-examine any witnesses, refused to mount a defence and frequently fell asleep in the prisoner’s box.

The trial, which began on 2 February, heard hours of secretly recorded conversations between Jaser, Esseghaier and an FBI agent who posed as a wealthy American businessman with radical views.

It was on those wiretaps that Jaser and Esseghaier were heard musing about alleged terror plots to be carried out in retaliation for Canadian military action in predominantly Muslim countries.

Investigators said the men were advised by al-Qaida members in Iran. That raised questions about the extent of Shia-led Iran’s complicated relationship with al-Qaida, the predominantly Sunni Arab terrorist network. Iran’s history with the group ranges from alliances of convenience to outright hostility, even overtures by Tehran to assist Washington after the 9/11 attacks on the US.