The right-wing populist party of anti-Islam firebrand Geert Wilders has gained footholds for the first time in dozens of municipalities across the Netherlands, but has struggled in some key cities.

Local elections held in 335 Dutch municipalities are a barometer of support for national parties but are complicated by the popularity of small parties focused on local issues.

Near-complete results shown by national broadcaster NOS on Thursday had local parties winning nearly 33 percent of the vote.

Wilders' Party for Freedom fielded candidates in 30 municipalities and won seats in them all. But it lost ground in the only two municipalities where it took part in elections four years ago — The Hague and Almere — and did not do as well as it had hoped in Rotterdam.