Many Germans are in shock over Wednesday's attack in which two people were killed outside the synagogue and in a kebab shop. The attack has renewed concerns about rising far-right extremism and questions about the slow police response.
The 27-year-old, heavily armed suspect identified as Stephan B. tried but failed to enter the house of worship on Yom Kippur, Judaism's holiest day. The suspect, who livestreamed his attack online, has been charged with two counts of murder and nine of attempted murder.
On Sunday, people started their march at a symbolic landmark, Berlin's Bebelplatz square, where the Nazis burnt thousands of books by Jews, Communist and other opponents, weeks after Adolf Hitler took power in 1933.
The marchers carried Israeli flags and banners with slogans like "No Nazis" or "Far-right terror threatens our society." The rally was organized by the civil rights group Unteilbar, or "Indivisible," under the slogan "We stand united" and ended at the city's New Synagogue with its famous golden dome topped by a Star of David.
Friedhelm Schmitt, a 52-year-old neurologist, said he'd joined the protest "because I had to. It's my democratic duty. It's like going to vote." German prosecutors have said the suspect wanted to carry out a "massacre" in the synagogue and had about four kilograms (nearly nine pounds) of explosives in his car.
He unsuccessfully tried for several minutes to enter the house of worship, where more than 50 people were attending a prayer service, but the door withstood his shots. He then killed two people and severely injured a couple before he was detained by police.
Police have been criticized because they arrived at the synagogue seven minutes after they were alerted to the shooting.