Similar protests took place in Dresden, Koethen and other eastern cities
Protestors from across Germany marched through Berlin on Saturday against xenophobia and the far right in one of the country's biggest rallies of recent years.
Organizers put the turnout at more than 150,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 protest, which was organized by 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.
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.