OSLO - Three Norwegians on Friday received prison sentences ranging from seven months to almost five years after they were convicted of supporting or belonging to the Islamic State group.

The two men who received the longest sentences had both spent time in Syria. The 28-year-old man with Albanian origins and the 30-year-old with a Somali background were handed down prison terms of four years and nine months and four years three months respectively for belonging to the jihadist organisation.

Both men claimed they had only performed humanitarian tasks during their time in Syria, but the court in the capital Oslo alleged they knew it had been illegal since June 2013 in Norway to belong to the group. A 25-year-old man received a seven-month prison term for violating weapons’ laws and trying to send military equipment from Norway to a brother in Syria.

European nations are struggling to deal with citizens who join the fight in Syria or Iraq and then return home. This case was the first test of Norway’s law banning any support for a terrorist organisation. According to Norway’s intelligence services more than 70 of the country’s citizens have taken part, or are still engaged in the fighting in Syria.