Dresden (Germany) (AFP) - The founder of Germany's xenophobic and anti-Islamic Pegida movement went on trial Tuesday on hate speech charges for allegedly 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 was 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 one million asylum seekers to Germany last year.

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

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

Bachmann, who has branded the process a "political show trial", appeared smiling at the court, wearing a pair of glasses that mimicked the black bars printed over people's eyes in censored photos.

Outside the court, several dozen supporters cheered Bachmann and waved signs that demanded putting "Merkel on trial", as chanting counter demonstrators yelled "Jail for Bachmann".

While he did not speak in court, his defence lawyer Katja Reichel said Bachmann had not written the offending words, and that rather his Facebook account may have been "hacked".

However, the court also watched video footage of a Pegida rally in January 2015 where Bachmann appeared to be defending the Facebook comments, saying he had merely "used words that everyone has used at least once".

Pegida rallies at that time peaked at around 25,000 people, but interest then began to wane following wide coverage of Bachmann's overtly-racist comments and the surfacing of "selfies" in which he sported a Hitler-style moustache and hairstyle.

- 'Criminal invaders' -

The pendulum swung back a few months later, as tens of thousands of asylum-seekers -- many fleeing war in mostly Muslim countries such as Syria, Iraq and Afghanistan -- poured into Germany each week.

Story continues

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, Bachmann made no reference to his trial but waded into a row over a German TV comedian who wrote a satirical poem about Turkish President Recep Tayyip Erdogan.

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

"Imagine the outcry... if that poem had been written by me," Bachmann told a crowd of several thousand.

"I would have been immediately arrested on stage, placed in custody... (and) executed," he said sardonically.

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

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

- Hotspot for attacks -

The eastern state of Saxony, of which Dresden is the capital, has been a hotspot for many of the 800 attacks on refugee shelters recorded in Germany last year.

Small towns such as Freital near Dresden earned nationwide notoriety last year as neo-Nazis and angry residents hurled abuse at people fleeing war and misery -- and rocks at police sent to protect those seeking a safe haven.

An elite German police anti-terror unit carried out dawn raids Tuesday to capture five right-wing extremist suspects accused of attacking refugee shelters and political opponents, federal prosecutors said.

The suspects, four men and a woman, are accused of belonging to a far-right terrorist organisation called the Freital Group.

"According to preliminary investigations, the aim of the group was to carry out explosives attacks on homes for asylum seekers as well as the homes of political opponents," the prosecutor's office said in a statement.

It said the suspects stockpiled hundreds of fireworks from the Czech Republic to use in attacks. The assaults include blowing out the windows of the kitchen of a refugee shelter in Freital in September 2015.