A 29-year-old Gatineau man is on trial in Montreal.

Ismael Habib is charged with trying to leave Canada to join ISIS in Syria.

In court on Friday, one of many undercover RCMP agents testified about how he was able to befriend Habib, and convince the accused the agent was the boss of a criminal organization.

The Mountie convinced Habib that he could bring people to the Middle East by boat, which Habib was eager to do, having had his passport seized last year.

According to the testimony in court, during the exchange Habib openly admitted his allegiance to ISIS, said he had contacts in Syria, and also said he was happy about the terror group's deadly attacks in Paris.

The officer testified that Habib admitted having fought in Syria in 2013, and that he could provide names of other people interested in travelling to join ISIS.

The undercover RCMP agent also asked Habib where he could recruit young people willing to joining the Islamic group.

Habib said there was a mosque, the name of which he couldn't remember, and said he could go to the cultural centre run by controversial Imam Adil Charkaoui.

Charkaoui, who spent years under a security certificate, has denied any connection to terrorist groups, and on Friday pointed out the specific language used by Habib did not indicate that Habib had ever visited his centre.

Habib is the first Canadian on trial for attempting to leave Canada to join a terrorist group.

He is also facing charges of lying to obtain a passport. .