The founder of Germany's anti-Islam movement, PEGIDA, will appear in court on hate speech charges for branding refugees "cattle" and "scum" on social media.

Lutz Bachmann, founder of the far-right "Patriotic Europeans Against the Islamisation of the Occident" movement, was charged in October with inciting racial hatred through a series of widely shared Facebook posts.

The trial on Tuesday will be held under tight security in Dresden in the former communist east, the birthplace of PEGIDA, which bitterly opposes Chancellor Angela Merkel's liberal migration policy that brought more than a million asylum seekers to Germany last year.

The court said the 43-year-old's comments, which date back to 2014, also "disrupted public order" and constituted an "attack on the dignity" of refugees.

If found guilty, Bachmann could face between three months and five years in jail.

The comments were published in September 2014, shortly before PEGIDA started life as a xenophobic Facebook group.

The group initially drew just a few hundred supporters to demonstrations in Dresden before gaining strength, peaking with rallies of up to 25,000 people in early 2015.

Also on Tuesday, police arrested five people near Dresden whom they suspected of forming a far-right militant group, according to Reuters news agency. The public prosecutor's office said they were preparing attacks on asylum seekers using explosives.

'Criminal invaders'

Bachmann has repeatedly labelled the newcomers "criminal invaders" while also railing against "traitor" politicians and the "liar press", whom he blames for jointly promoting multiculturalism.

At PEGIDA's weekly rally in Dresden on Monday evening, Bachmann made no reference to his trial but hurled a barb at the row over a German comedian who has written a satirical poem about Turkish President Recep Tayyip Erdogan.

Popular comic Jan Boehmermann could be convicted under the rarely enforced section 103 of the criminal code - insulting organs or representatives of foreign states.

A trained chef and head of a public relations agency, Bachmann has previously been convicted of drug, theft and assault charges.

READ MORE: Turkey's Erdogan files case against German comedian

In the late 1990s, he left Germany for South Africa to avoid a jail term, but was extradited two years later and served more than 12 months behind bars in Germany.

In the current heated political climate, the right-wing populist Alternative for Germany (AfD) party also made strong gains in recent state elections on the back of a protest vote against Merkel's open-door policy on refugees.

This week, AfD deputy leader and member of the European parliament Beatrix von Storch described Islam as "a political ideology that is incompatible with the German constitution".

Aiman Mazyek, chairman of the Central Council of Muslims in Germany, accused the party of "riding a wave of Islamophobia.

"It is the first time since Hitler's Germany that there is a party which discredits and existentially threatens an entire religious community," he told AFP news agency.

Germany is home to about four million Muslims, and many of the country's most recent arrivals adhere to the faith.