Ismael Habib, 29, told an undercover agent he was a member of the Islamic State and believed the group was "purifying" Syria, Quebec Court Judge Serge Délisle heard Thursday.

The RCMP agent known as "the Boss" continued his testimony on the fourth day of the Montreal man's trial on charges of attempting to leave Canada to commit terrorist acts and giving false information to obtain a passport.

The Boss, whose real identity is protected under a publication ban, is the third RCMP undercover agent called as a witness by the prosecution, led by federal Crown prosecutor Lyne Décarie.

He testified that his objectives varied, but for the most part, his cover role involved calling Habib and inviting him to do odd jobs for cash between December 2015 and February 2016 — the month Habib was arrested in an alleged domestic altercation with his girlfriend in Gatineau.

Federal Crown prosecutor Lyne Décarie has so far called three RCMP undercover agents as witnesses. (CBC)

Wanted to go to Syria

The agent testified that over lunch last Jan. 14, Habib told him he wanted to go to Syria to join his wife and two children. Habib said he also wanted to bring his Gatineau girlfriend overseas.

While eating poutine, Habib told the Boss he belonged to the Islamic State, which he said was "similar to the Hells Angels," the agent testified.

The Boss said by then Habib was comfortable and friendly with him, divulging that during his 2013 trip to Turkey — where he was arrested by Turkish authorities and had his passport seized — he spent three months in Syria, and that he wanted to go back to that country in less than a year.

At one point during the meal, the Boss testified, Habib said he'd do "anything" to get to Syria, while making a gesture with his hands that looked like a shooting gun.

Ismael Habib appeared in a Gatineau courtroom for a bail hearing on March 3, 2016. (Laurie Foster-MacLeod)

More information on shoebox operation

The Boss testified he managed an operation that saw Habib and another undercover operative take a box full of fake passports to Ontario and drive back.

At the end of the mission, Habib asked how much the fake passports cost. He told the Boss he had friends who might want some. Earlier in the trial, another undercover agent testified Habib believed the Boss could sell him a passport.

After the mission, the Boss gave Habib $1,000 in hundred-dollar bills and thanked him for his work.

Mystery GPS

In several meetings with the Boss, the agent testified, Habib expressed interest in having his girlfriend's car stolen so he could get the insurance money. The Boss said he was noncommittal to the idea or tried to dissuade him.

During a meeting in a restaurant on Jan. 14, Habib mentioned something new: After an abrupt stop in his car, a GPS of unknown origin fell out of his dashboard.

"I was surprised by that information," testified the Boss. Habib described it as a black box, thicker than an iPhone 5, with a cord attached.