BERLIN—Several thousand demonstrators from across Germany gathered in the capital Sunday for a rally organized by the far-right Alternative for Germany party, with anti-AfD protesters lining the route in central Berlin.

About 2,000 police officers provided security for the AfD.

The party estimated that about 5,000 had turned out for its event. Previously, the party said about 1,000 would attend.

Started as a euroskeptic party, the AfD got a boost in 2015 after Chancellor Angela Merkel announced an open-door policy to refugees fleeing places such as Syria and Afghanistan. The surge in foreigners stoked public concerns that helped the AfD enter the national parliament last year as the main opposition party.

But the party’s success has also prompted a pushback from various groups under the umbrella organization “Stop the Hate.”

Thousands of counterdemonstrators lined the Spree River near the Reichstag building, the seat of the parliament, putting themselves along the path the AfD members were planning to take from Berlin’s central train station to the Brandenburg Gate.

The counterdemonstrators booed and whistled at the AfD supporters. Some also launched boats in the river to protest.

Leftist groups have also announced plans to blockade the AfD supporters’ movements.

Not to be outdone, representatives of Berlin’s night-life scene said they would also launch a parade of musical floats towards a site near to the gate.

Read more about: