Authorities in the southwestern city of Karlsruhe expected at least 900 people to participate in Saturday's demonstration organized by a tiny far-right group, Die Rechte (The Right). Police feared that some of the protesters could turn violent during Die Rechte's "Day of the German Future" event. About 300 had joined the rally by late afternoon, according to police.

Far-right demonstrators walk behind their 'Day of the German Future' banner

A counterdemonstration was expected to draw at least 6,000 people. There were several arrests after some people tried to break through police barriers. Police used pepper spray and batons to control the crowd and there were reports of slight injuries to police and demonstrators.

Counterdemonstrators stood behind their banner 'No Day of the German Future'

Police had planned to deploy some 3,000 security personnel, including horse-mounted and canine units, to Karlsruhe's Durlach district to prevent possible acts of violence. It was the largest police deployment in a German city in years, highlighting the gravity of the situation.

Thousands of police were deployed in Karlsruhe

Authorities barred several Die Rechte speakers from appearing on stage based on their previous attempts at inciting violence, and stopped organizers from using unconstitutional emblems or flags at the demo.

On Saturday, the city of Karlsruhe also hosts its annual gay pride festival, under the slogan "Colorful love instead of brown (Nazi) hate."

Far-right groups have held a number of demonstrations in Karlsruhe in the past. In February 2015, for example, a large right-wing group march took place under the label Kargida.

Anti-refugee and anti-Islam groups such as PEGIDA have gained strength in Germany over the past few years following a massive influx of migrants from war-torn Middle Eastern and North African countries to Europe.