Police estimated Monday evening's crowd at around 5000 and said the demonstration passed without incident.
Among those taking part were prominent German climate activist Luisa Neubauer and the lead candidates for the Greens and Die Link (The Left) in Berlin's state election, which is scheduled for 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 controversial party comfortably won Sunday's election but fell short of an absolute majority, leaving open the possibility of Germany's first AfD-led state government.
AfD could end up taking power with the help of a small leftist party that shares its hostility to mass immigration and to the mainstream parties' efforts to exclude more radical parties from power.
While mainstream parties, including Chancellor Friedrich Merz's CDU conservatives, have long refused to work with the AfD - in a policy known as the 'firewall' - the far-left BSW reaffirmed its readiness to play kingmaker after it cleared the five per cent threshold to enter Saxony-Anhalt's state parliament.
"We've made no secret from the beginning that we'll talk with all parties. The AfD is part of that," Thomas Schulze, the BSW party's lead candidate in the state election, said on Monday.
Schulze described the mainstream parties' refusal to work with the AfD as "undemocratic".
As well as their hostility to Germany's political establishment and their social conservatism, the two parties share a number of priorities, including a hostility to mass migration - which the BSW says harms local workers' rights - suspicion of the mainstream media and a desire to end financial and military support for Ukraine and restore ties with Russia.
The nation's 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.
- with Reuters