"The court also deduced from a conversation with two unknown persons that the suspect was searching for a target for the attack," it added in a statement.
The 31-year-old man, identified by Dutch media only as Jaouad A. was arrested in December last year after police raided his home in the western port city of Rotterdam.
The raid was launched after "alarming" information by the Dutch intelligence services.
Police found an AK-47 assault rifle, two clips of ammunition as well as a painting with a picture of the flag used by the Islamic State group and some 1,600 euros ($1,800) in cash.
Four boxes with 288 "deadly Cobra 6 fireworks" -- large firecrackers which cause explosions and large smoke clouds were found in a child's room, Dutch public prosecutors said last month.
The suspect's computer and an external hard drive contained "IS videos and magazines with very violent material such as mutilations, beheadings and other atrocities" while his phone contained hundreds of pictures and videos about the IS group.
Police also found online instructions how to make pipe bombs and suicide vests.
Another document advised "how to kill unbelievers in your own country if a trip to the battlefield is impossible."
"It has been proven that the man is guilty of actively searching, possessing and distributing extremist propaganda about the armed jihad," the court said.
Jaouad "contributed to international terrorism aiming to create fear among the Dutch population," the judges said.
Prosecutors last month asked for an eight-year sentence and the accused denied planning an attack, saying he was conducting "an investigation".
Rotterdam is Europe's busiest port, and one of The Netherlands' most multi-cultural cities, home to many who have emigrated from abroad.
The Netherlands has so far been spared while terror attacks have affected all its closest European neighbours in recent years.