AMSTERDAM (Reuters) -Dutch King Willem-Alexander and Prime Minister Mark Rutte joined around 4,000 people on Saturday for the country's annual World War Two remembrance ceremony amid restricted public access and heightened security due to the war in Gaza.

The ceremony on Amsterdam's central Dam square, with the traditional two minutes of silence at 8 p.m. (1800 GMT) to commemorate the victims of World War Two, passed smoothly despite fears that there might be protests.

Normally some 20,000 people attend the Dam commemoration without having to register. But earlier this week municipal authorities announced unprecedented security measures to keep the ceremony safe and avoid possible disruptions linked to the Israel-Hamas war.

At the opening of a Holocaust Museum in Amsterdam in March, pro-Palestinian protesters opposed to Israel's military campaign in Gaza set off fireworks and booed Israeli President Isaac Herzog as he arrived on a visit.

Every town and the city in the Netherlands holds its own remembrance ceremony on May 4 and tens of thousands of people attend the events. The Netherlands then marks on May 5 the anniversary of its liberation from Nazi occupation in 1945.

(Reporting by Stephanie van den Berg and Piroschka van de Wouw; editing by Giles Elgood and Gareth Jones)