A former Canadian engineering student detained over fears he might commit a terrorist act was formally charged on Tuesday with participating in the activities of a terrorist group.

Kevin Omar Mohamed, 23, appeared briefly in a Toronto area court to face the charge, which was in addition to two weapons offenses laid by federal police when he was arrested last week in possession of a knife.

The Royal Canadian Mounted Police (RCMP) said he had traveled to Turkey on or around April 24, 2014 to join the Qaida-linked al-Nusra Front.

He flew back to Canada a month later.

The RCMP had initially sought a court order against Mohamed requiring him to be on good behavior under a controversial law aimed at preventing attacks and stopping people from travelling abroad to join extremist groups.

"While there was no indication of any plans for a domestic attack, we must remain committed to preventing individuals from traveling abroad to gain training and expertise that could be used in the planning and implementation of future attacks on Canadian soil," RCMP Superintendent Lise Crouch was quoted as saying after the arrest.

About 60 Canadians who traveled abroad to join terror groups are now back in the country, and another 180 are estimated to be overseas engaged with extremists, Canada's spy chief Michel Coulombe told a newspaper last month.