A Quebec man, who was found guilty in June of attempting to leave Canada to join the extremist group ISIS, has been sentenced to nine years in prison.

Ismael Habib, 29, is the first adult to be tried on charges of attempting to leave Canada to participate in terrorist activity — a section of the Anti-terrorism Act enacted by Stephen Harper's government in 2013.

Quebec Court Judge Serge Délisle announced the sentence Friday afternoon.

"This wasn't a utopian or irrational project of a manipulated adolescent. Rather, it was done with perfect knowledge of the objectives of the Islamic State and its methods used," Délisle said. "The offender multiplied his efforts to get to Syria to join the Islamic State."

"He didn't plan on getting there to play a passive role. He was ready to do anything for the Islamic State, up to dying."

Habib, who was facing up to 10 years in prison, was sentenced to eight years for attempting to leave Canada and one year for providing false information to obtain a passport.

The sentences will be served consecutively and minus the time he's already served in custody, Habib will spend another six and half years in prison. He must serve half of his sentence before applying for parole.

The Crown welcomed the decision since it had sought a nine-year sentence, arguing Habib buys into the ideology of the Islamic State and shows no remorse.

"The message sent by the court is that people who have the same idea to do the same thing will have to think twice," said Crown prosecutor François Blanchette.

But defence lawyer Charles Montpetit had said there's no proof his client buys into radicalism completely or that he's a danger to the public. He had proposed a sentence of six years and six months.

Ismael Habib

Ismael Habib, shown in a court sketch, appears in a Gatineau, Que., courtroom for a bail hearing on March 3, 2016. (Laurie Foster-MacLeod)

A videotaped confession, a history of deceit

During the ​trial, it was disclosed 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 told the court he wanted to go overseas to rejoin his wife and children, who had been living abroad without him. 

He testified he confessed to wanting to fight with ISIS 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. 

But the judge rejected Habib's version of the facts, saying he had a history of deception and pointing out that Habib had been looking for girlfriends online and eventually moved in with a woman in Gatineau, Que.

On Tuesday, Habib was handed a nine-month jail sentence for threatening and harassing his former girlfriend in a case unrelated to the terrorism charges.

With files from CBC's Elias Abboud and Kate McKenna