A summary of the court's decision read: "The court considers this so insulting for Muslims that it is in the public interest to prosecute Wilders.
"The court also considers appropriate criminal prosecution for insulting Muslim worshippers because of comparisons between Islam and Nazism made by Wilders."
The MP said the ruling marked a "black day for me and for freedom of speech".
The film's title is an Arabic word which has numerous meanings including "sedition" and "temptation" and which appears in the Quran. Wilders urged Muslims to tear out what he described as "hate-filled" passages from the religious text.
Its screening prompted protests in Pakistan, Iran, Indonesia and Afghanistan, while Ban Ki-moon, the United Nations secretary-general, described the film as "offensively anti-Islamic".
Wilders is the leader of the right-wing Dutch Freedom Party (PVV), which has nine seats in parliament.
Last year, the public prosecutor's office ruled against prosecuting the politician, saying his film and interviews were painful for Muslims but not criminal.
'Attack on free speech'
Wilders said he was "shaken" by the latest ruling. "I had absolutely not expected it," he said.
He said he saw "the judgment of the court as an attack on the freedom of expression".
"Participation in the public debate has become a dangerous activity. If you give your opinion, you risk being prosecuted. Who will stand up for our culture if I am silenced?"
Gerard Spong, a lawyer who joined Islamic groups in pushing for Wilders' prosecution, welcomed the decision.
"This is a happy day for all followers of Islam who do not want to be tossed on the garbage dump of Nazism,'' Spong said.