A damning confession made by a Quebec man days before his arrest on a terrorism-related charge can be used against him, a judge has ruled.

After months of deliberation, Judge Serge Délisle of Quebec provincial court has decided the RCMP did not break the rules in conducting an elaborate undercover sting operation against Ismael Habib.

In the sting, Habib, 29, told an undercover RCMP officer it was his "duty" to fight jihad alongside ISIS. He also confessed to whipping a prisoner on a 2013 trip to Syria.

He was arrested days later in his home in Gatineau, Que., on unrelated charges, after an apparent domestic dispute. Once in custody, he was charged with the terrorism-related offence.

The trial of Habib, who was born and raised in Montreal, resumed Monday after a six-week recess. Defence lawyer Charles Montpetit is expected to begin his arguments on Wednesday.

First adult tried under new terrorist law

Habib is charged with attempting to leave Canada to participate in the activities of a terrorist group and providing false information to obtain a passport.

Ismael Habib, seen here in a court sketch from last March, told an undercover RCMP officer it was his 'duty' to fight jihad alongside ISIS. (Laurie Foster-MacLeod) He is the first adult being tried under a section of the Anti-terrorism Act that was enacted under the Conservative government in 2013.

In the course of the police sting, he confessed to an undercover agent posing as a crime boss peddling fake passports that once he found a way out of Canada, he planned to go to Syria to fight with ISIS.

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

Questions surrounding confession

In the ruling issued Monday, the judge had to decide whether the undercover operations constituted what is called a "Mr. Big" sting, where police officers create a fictitious criminal organization and then seduce the suspect into joining it.

The method has resulted in hundreds of recorded confessions, often in cold case murders.

The lawyer representing Ismael Habib, Charles Montpetit, will present arguments on Wednesday. (CBC) However, in 2014, a landmark Supreme Court decision put limits on how police are allowed to use Mr. Big stings.

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.

In his decision, Délisle found that, despite some modifications made by RCMP, the method used against Habib still qualified as a Mr. Big sting.

The judge ruled it should be admissible, since Habib was not coerced into giving his confession and because it was corroborated by other evidence.

​