Several thousand people gathered at Berlin's Brandenburg Gate on Monday evening to protest against the far-right Alternative for Germany (AfD) following its landslide victory in the state election in Saxony-Anhalt.

Police estimated the crowd at around 5,000 and said the demonstration passed without incident, while organizers put the number of participants at around 14,000.

The rally was called at short notice by campaign organization Campact and the Fridays for Future climate movement.

Among those taking part were prominent German climate activist Luisa Neubauer and the lead candidates of the Greens and The Left in Berlin's state election on September 20.

Protesters carried banners with slogans including "Fascism is not an alternative" and "Stop AfD Nazis! End racism and social cuts," while crowds chanted: "All together against fascism!"

The party won Sunday's election by a wide margin but fell short of an absolute majority, leaving open the possibility of Germany's first AfD-led state government.

The domestic intelligence agency has classified the AfD's state branch as "confirmed right-wing extremist."

Hundreds of people also gathered in nearby Potsdam on Monday evening to protest against the AfD.