This was the full sentence the Crown asked for in the precedent-setting case.
"Anything less trivializes the nature of his actions," said the judge about the sentence from the Peel Region court in Brampton, Ont.
Hersi was convicted of attempting to participate in terrorist activity abroad and trying to enlist an undercover officer. The Crown argued he was trying to join the Somali militant group al-Shabaab, which Canada deems a terrorist entity.
The 28-year-old, who was working as a security guard, intended to travel onward to Somalia to join al-Shabaab, the Crown said.
He was bound for Cairo when he was arrested at Toronto's Pearson International Airport in 2011.
Hersi never officially joined the group and denied the allegations, saying he was going overseas to study Arabic for several months.
Hersi is the first person convicted in Canada for offences related to Criminal Code's Section 83.18, which makes it illegal to "knowingly participate" or "knowingly contribute" to "any activity of a terrorist group for the purpose of enhancing the ability of any terrorist group to facilitate or carry out a terrorist activity."
Hersi will be eligible for parole only after half of his sentence is served.
Also on HuffPost