(CNN) -- Controversial Dutch politician Geert Wilders was cleared Thursday of inciting hatred against Muslims, the Dutch justice ministry said.

Wilders was tried for inciting discrimination and hatred over a controversial film he made about Islam.

The court in Amsterdam said comments by the leader of of the Party for Freedom were "denigrating," but not illegal, the ministry said.

Wilders' film "Fitna," which he released online in March 2008 to international outcry, features disturbing images of terrorist acts superimposed over verses from the Quran in an apparent attempt to paint Islam as a threat to Western society.

It drew complaints from the European Union and the Organization of the Islamic Conference, as well as concern from the United States.

Comments Wilders made in a variety of media between 2006 and 2008 formed part of the case against him.

Wilders said he did nothing wrong. If found guilty, he would have faced up to two years in prison and a fine of up to 19,000 euros ($26,000) for each charge.

CNN's Nina Dos Santos and Bharati Naik contributed to this report.