The first Canadian man convicted of attempting to join a terrorist group has been sentenced to 10 years in prison.

Mohamed Hassan Hersi, 28, became the first man to be sentenced under Canada's anti-terrorism lawThursday after a judge handed down the sentence in a Brampton, Ont. courtroom.

The Toronto man was convicted last May of attempting to join an overseas terrorist organization, and of counselling a person to participate in terrorist activity.

The Crown argued Hersi intended to travel to Somalia to join the terrorist group al-Shabab. He was arrested at Toronto's Pearson Airport in March 2011 bound for Cairo, claiming he was going to Egypt to study Arabic.

Hersi argued he was the victim of entrapment, but the court dismissed his objection.

Hersi's lawyer, Paul Slansky, said his client will appeal the conviction and the sentence. "Even taking into account those findings of fact, it's still an error in principle to have sentenced the maximum," he told reporters outside the court.

Slansky also said police had no reasonable grounds to investigate Hersi in the first place. The investigation began when a dry cleaner found a computer memory stick containing a manual for making explosives.

An undercover officer testified that Hersi, who was born in Somalia and came to Canada as a child, told him he had planned to join al-Shabab.

The sentencing comes just one day after police charged a British Columbia man with leaving the country to join a terrorist group. Police say 25-year-old Hasibullah Yusufzai has travelled to Syria to join Sunni militants there.

With files from The Canadian Press