The sentence is the longest imposed so far for crimes of terrorism in Denmark, with life in prison being the maximum allowed.
Syrian-born Ali Al Masry, 35, was found guilty of an "attempted terrorist act" by a court in Holbaek, a suburb of Copenhagen, and of financing and promoting "terrorist activities".
He was arrested in February 2021 with his Syrian brother and Iraqi-born Danish wife in a joint Danish-German operation.
"We are convinced that with these arrests we prevented an attack from being carried out," prosecutors John Catre Nielsen and Kirsten Jensen said.
Al Masry pleaded not guilty, saying 12kg of powder and chemicals found in his flat had been intended for a fireworks display.
Lebanese men join ISIS to escape poverty- in pictures
He will be deported after serving his prison sentence in Denmark.
His wife, 31, and brother, 37, were found guilty of financially supporting Al Masry and jailed for nine and six months respectively.
His brother will also be deported after serving his sentence.