A German court sentenced seven men and one woman to four to 10 years in jail on Wednesday for founding a far-right "terrorist" group responsible for attempted murder and bomb attacks on refugee shelters and politicians.

Prosecutors accused the group of being driven by xenophobic, right-wing views and a Nazi ideology and of wanting to create a climate of fear that would drive out foreigners.

The individuals were members of the Freital Group, named after their base in the state of Saxony, a bastion of support for the right-wing Alternative for Germany (AfD), which won the most votes there in a September federal election.

After a year-long trial, Dresden's high court sentenced seven members of the group to between five and 10 years behind bars. The eighth got a youth sentence of four years, a spokeswoman said.

At least some of the defendants have appeared in court covering their faces with hoodies during their trial.

The charges against them included belonging to a "terrorist" organisation, attempted murder, setting off explosives, grievous bodily harm, attempted grievous bodily harm, and damage to property.

In one of the attacks cited by prosecutors, the suspects detonated explosives next to windows at a refugee shelter, knowing that there were people inside. One resident suffered cuts but prosecutors argued it was luck that no one was seriously hurt or even killed.

The suspects also set off explosives on a car belonging to a local politician from the Left Party.

The prosecutors say the group targeted refugees, aid workers, and leftist politicians and acquired large quantities of explosives in the Czech Republic that are illegal in Germany.

About one million refugees arrived in Germany in 2015 alone, many of them fleeing the war in Syria.

There were 950 attacks reported against Muslims and mosques in the country in 2017, according to new government figures.

According to the Interior Ministry, at least 33 Muslims were injured in the attacks, which included assaults against Muslim women wearing headscarves.