Berlin — To many Germans, the violence in Charlottesville, Va., this month and the American president’s reaction to it came as a shock. Even those who have come to expect little of Donald Trump — he’s a uniquely unpopular figure among Germans — were aghast. “It’s racist, far-right violence, and that requires determined and forceful resistance no matter where in the world it appears,” Chancellor Angela Merkel said.

What a strange moment, when the German chancellor lectures the American president on how to deal with neo-Nazis. But it’s also an instructive one, in that it highlights how the two countries deal with extremism.

In Germany, the very presence of neo-Nazis openly marching through a city bearing swastika-emblazoned flags, as in Charlottesville, is unthinkable. Unlike the United States, Germany places strict limits on speech and expression when it comes to right-wing extremism. It is illegal to produce, distribute or display symbols of the Nazi era — swastikas, the Hitler salute, along with many symbols that neo-Nazis have developed as proxies to get around the initial law. Holocaust denial is also illegal.

The law goes further. There is the legal concept of “Volksverhetzung,” the incitement to hatred: Anybody who denigrates an individual or a group based on their ethnicity or religion, or anybody who tries to rouse hatred or promotes violence against such a group or an individual, could face a sentence of up to five years in prison.