BERLIN (Reuters) - Protestors from across Germany marched through Berlin on Saturday against racism, xenophobia and the far right in one of the country’s biggest rallies of recent years.

Organizers put the turnout at 242,000 people for the demonstration, which followed anti-immigration protests in several eastern cities over the summer and a rise in support for the far-right Alternative for Germany (AfD) party before a state election on Sunday.

A police spokesman declined to estimate the size of the crowd at the march, which was organized by a broad alliance of associations, labor unions, parties and rights groups including Amnesty International.

Marchers carried placards reading “Build bridges not walls”, “United against racism” and “We are indivisible - for an open and free society”. Some danced to pop music on a warm autumn day.

The arrival of more than a million migrants, many from war zones in the Middle East, has boosted support for the AfD. It is expected to fare well in the election in Bavaria, long a stronghold of the conservative Christian Social Union, a member of the Chancellor Angela Merkel’s federal coalition government.

In August, far-right groups in the eastern city of Chemnitz clashed with police and chased people they believed to be foreign after the fatal stabbing of a German man blamed on two migrants. Similar protests took place in Dresden, Koethen and other eastern cities.

Merkel has accused AfD politicians of using the violent protests to stir up social tensions.

Nevertheless, the number of violent attacks on refugees and asylum shelters in Germany has fallen sharply in the first half of this year.

Two companies have also warned their German employees about the dangers of populism before the regional election in Bavaria while the head of the BDI industry association has said the economy could be hurt by a wave of nationalism.