The man has appealed against the sentence.
Also sentenced with conditional deportation, the man was found guilty of making and possessing a bomb, prosecutor Lars Petersen of East Jutland Police told news agency Ritzau.
The apartment block where the man was detained. Photo: Michael Barrett