Populist Dutch MP
Wilders, 53, who had previously shunned hearings held at a high-security courthouse near Amsterdam's Schiphol airport, addressed a three-judge bench at the end of the three-week trial which will formally be closed on Friday.
"I am not a racist and my voters are neither. They are people who want their country back and who are sick and tired of not being listened to," said Wilders, dressed in a dark blue suit and with his trademark peroxide hairdo.
"If you convict me, you will convict half of The Netherlands," said Wilders, who added: "Many Dutch will then lose the last bit of trust in the rule of law."
The firebrand far-right politician faces charges of insulting a racial group and inciting racial hatred after comments he made about Moroccans living in the Netherlands.
Set for a verdict on December 9, the trial focuses in part on a comment made at a March 2014 local government election rally, when Wilders asked supporters whether they wanted "fewer or more Moroccans in your city and in the Netherlands".
When the crowd shouted back "Fewer! Fewer!" a smiling Wilders answered: "We're going to organise that."
The Netherlands will hold general elections in March and Wilders's far-right Freedom Party (PVV) is riding high in various polls, a close second or even ahead of the ruling Liberal VVD party.
His 2014 statements were met with outrage, including from the small but vocal Dutch Muslim community. An avalanche of 6,400 complaints to police followed.
But Wilders accused prosecutors -- whom he referred to as government "puppets" -- and opposition politicians of directing a "political process" against him.
"The court is being abused to settle a political score," Wilders told the judges.
Earlier, public prosecutor Wouter Bos said Wilders could "say what he wants" but that "the law is clear and applies to everyone -- to Wilders too".
Goran Sluiter, a lawyer representing aggrieved groups and individuals who are demanding compensation from Wilders, told the judges "that only the law can protect minorities" in The Netherlands.
Whereas Wilders says the principle of freedom of expression was on trial, Sluiter told the judges that it was a "criminal process against an evil that's called discrimination".
Prosecutors last week demanded a 5,000 euro ($5,300) fine against Wilders, who has promised to close mosques, ban Muslim immigrants and withdraw The Netherlands from the European Union should he be voted into power next year.