BERLIN (AP) — Eight suspected far-right extremists went on trial Monday in Germany, accused of planning to start a violent uprising in response to a stabbing in the eastern city of Chemnitz last year.

The men, aged between 21 and 32, appeared before a regional court in Dresden on charges of forming a terrorist organization with the aim of overthrowing Germany's democratic order.

Prosecutors say the defendants — identified as leading members of Chemnitz's neo-Nazi, skinhead and hooligan scene — discussed in online chats which of their political enemies to target and how to obtain firearms.

Authorities say the group, which called itself "Revolution Chemnitz," were angered by the influx of migrants to Germany and intended to stage an attack on Oct. 3, 2018. The plan was foiled when the group's leader was arrested in connection with a Sept. 14 attack on migrants in Chemnitz.

The city had seen large protests days earlier over the killing of a German man by migrants. Among those participating in the protest were prominent members of the Alternative for Germany party, who marched alongside known neo-Nazis.

The defendants' lawyers rejected the prosecution's allegations.