Riot policemen stand guard as the right-wing supporters protest after a German man was stabbed last weekend in Chemnitz, Germany, August 27, 2018.

Far-right demonstrators clashed with leftist protesters in the eastern German city of Chemnitz on Monday after an Iraqi and a Syrian were arrested over a fatal stabbing that had triggered violent demonstrations.

Police said they brought in water cannons after fireworks were thrown from both sides, causing injuries.

State and local officials appealed for calm as thousands of people took to the streets and Chancellor Angela Merkel's spokesman said Germany would not tolerate "vigilante justice".

The unrest reflected a growing schism in German society after Merkel's government allowed about 1 million asylum seekers to enter the country in 2015, triggering a shift to the right in German politics.

Over a thousand leftist protesters massed near a giant statue of Karl Marx in Chemnitz on Monday evening to protest attacks on foreigners that occurred during an impromptu demonstration on Sunday after reports spread on social media about the stabbing of a 35-year-old German man.

"The scenes of people going after those who look like foreigners scare us. We want to show that Chemnitz has another side that is cosmopolitan and opposes xenophobia," Tim Detzner, the head of the radical Left party in Chemnitz, told the rally.

Nearly the same number of demonstrators waving German and Bavarian flags gathered nearby, some breaking through police barriers aimed at keeping the two sides apart. Many chanted "We are the people," a slogan used by far-right supporters.

The police in Saxony, the eastern state where Chemnitz lies, said on Twitter at around 1930 GMT that the demonstration had ended and they were accompanying participants to the train station.

Tensions were running high after some 800 demonstrators - including about 50 that police described as ready to commit violence - had taken to the streets on Sunday after the stabbing, which police said occurred after a row.

Local prosecutors said they had arrested two suspects, a 22-year-old Syrian man and a 21-year-old Iraqi man.