Norway has jailed two men for joining Islamic State in August 2014, shortly after IS declared a caliphate in Iraq and Syria.

A court Oslo Wednesday sentenced Hasan Ahmed, a 46-year-old Norwegian of Pakistani origin, to six years in prison and Adam Idrisovich Magomadov, a 23-year-old Russian of Chechen origin, to seven-and-a-half, in line with the requests by the prosecution.

The court said that they had “a clear and determined plan'' to “contribute to the organization's terrorist activities.''

Magomadov was handed a heavier sentence because he stayed in Syria longer and had maintained ties with IS even after his return to Norway.

The two men were convicted of belonging to IS and of "terror conspiracy." They travelled together to Syria and participated in IS training programs, pledged allegiance to the terrorist group and carried weapons in its name, the court said in its documents. Both had planned to go back to Syria.