A 29-year-old Quebec man has been found guilty of trying to join ISIS, in a case that legal experts say is a major test of Canada's anti-terrorism laws.

Ismael Habib is the first adult to proceed to trial on charges of attempting to leave Canada to participate in the activities of a terrorist group — a section of the Anti-terrorism Act enacted by the Stephen Harper government in 2013.

Habib sat still, listening intently while Quebec court Judge Serge Délisle read his decision.

Habib was arrested in February 2016, following an elaborate RCMP investigation that included a so-called Mr. Big operation.

During the ​trial, it was revealed that Habib told an undercover RCMP officer posing as a crime boss peddling fake passports that it was his "duty" to fight jihad alongside ISIS in Syria.

Unbeknownst to Habib, his confession was videotaped, and the Crown, led by federal prosecutor Lyne Décarie, entered that video as evidence to bolster its arguments.

During Habib's testimony in his own defence, he tried to explain away his confession. He told the court he wanted to go overseas to rejoin his wife and children, who had been living abroad without him.

He confessed to wanting to fight with ISIS, he said, because he desperately wanted the undercover officer to give him a passport — and he thought he was telling the officer what he wanted to hear.

Credibility questioned

In his decision, Délisle rejected Habib's version of the facts, saying he had a history of deception.

Délisle said that was inconsistent with other evidence heard in court: that he was looking online for other girlfriends and eventually moved in with another woman in Gatineau.

When he started dating the woman in Gatineau, he initially didn't tell her he had a wife living overseas, Délisle noted.

Defence lawyer Charles Montpetit addresses reporters following the Ismael Habib decision. (Kate McKenna/CBC )

The judge also wrote that Habib's credibility was hurt because he had tried on multiple instances to obtain a false passport and continued to take government financial support for his schooling despite having a record of dropping out or being kicked out for poor marks.

Crown pleased with decision

The judge's decision essentially agrees with the version of facts put forward by Crown prosecutor Lyne Décarie.

"We are very satisfied," said Décarie.

The defence, represented by Charles Montpetit, said he and his client will take time to reflect on what the judge wrote.

"My reaction is that I feel a little bit disappointed for sure, but we have to think it over," said Montpetit.

Ismael Habib has been found guilty of trying to leave Canada to join a terrorist organization and of providing false information to obtain a passport. (Laurie Foster-MacLeod)

Habib was arrested in February 2016, not long after his taped confession, in his home in Gatineau, Que., on unrelated charges of uttering threats and harassment, after an apparent domestic dispute.

Once in custody, he was charged with the terrorism-related offence.

Habib now faces a maximum 10-year sentence under the Anti-terrorism Act. He will return to court Aug. 17 for a sentencing hearing.

In May, he had been found guilty of providing false information in order to obtain a passport. That charge carries a maximum sentence of two years.

'A landmark decision'

Although Montpetit said he'll have to discuss with his client before deciding whether to appeal, at least one legal observer is anticipating there will be court challenges to the provision of the act used to charge Habib.

Charles Côté, a criminal lawyer, said it was likely the Supreme Court of Canada would be called upon to decide its constitutionality.

"It's a landmark decision that will be put down today," Côté told CBC News before the decision was announced.

"It's quite a brand-new type of law that we're experiencing here in Canada."

What is a "Mr. Big" sting?

In a Mr. Big sting, undercover police pretend to be part of a criminal organization. An officer posing as a gang member befriends the suspect, and after being hired to do menial odd jobs, the suspect is confronted by the boss of the fictitious gang and told to either confess to a past crime or explain some incriminating evidence in the boss's possession.

A Mr. Big confession can be found admissible only if it proves to be a critical piece of evidence that is corroborated by other evidence — and if the police can show they have not abused their power in persuading the accused to confess.