MONTREAL (Reuters) - A Canadian jury on Tuesday found a man guilty of possessing an explosive substance but cleared him and his partner of three terrorism-related charges after the government alleged they were trying to build a bomb with ingredients that included Christmas lights.

The Montreal couple, El Mahdi Jamali and Sabrine Djermane, were charged with trying to leave Canada to join a terrorist group, possessing an explosive substance, facilitating a terrorist activity and committing an offense for a terrorist group.

Jamali, now 20, was found guilty of a reduced charge of possessing explosives without a lawful excuse and acquitted of other charges.

Jamali was given credit for time served and ordered released during a Tuesday afternoon hearing. He was also prohibited from owning a firearm for 10 years.

Djermane, 21, was acquitted of all charges. The two had been detained since they were arrested in 2015, when they were teenagers.

The Royal Canadian Mounted Police found a handwritten bomb-making recipe copied from a propaganda magazine published by al Qaeda militants when the police searched a condo rented by the couple in 2015, according to prosecutors.

The two were arrested at a time when international security forces reported that college students from Montreal were among waves of young people heading to Syria to join Islamic State militants.

RCMP began investigating the couple after receiving a tip, and arrested them days later.

Canadian prosecutor Lyne Decarie said she has not ruled out filing an appeal and would examine the judge’s instructions to the jury.

The government has 30 days to file an appeal.