The youngest of eight suspects accused of waging a violent terrorist campaign against immigrants and left-wing political opponents in eastern Germany has confessed and testified against his co-defendants.

The 19-year-old, identified in line with German privacy laws as Justin S, told a court in the city of Dresden on Tuesday that he took part in bombing attacks on refugee accommodation in nearby Freital and an alternative housing initiative outside the city.

He also admitted to helping his suspected fellow members of the right-wing extremist Freital Group in an attempt to blow up a left-wing politician's car.

The alleged right-wing terrorists are suspected of carrying out five bombing attacks with the help of illegal pyrotechnics in order to foster "a climate of fear and repression," according to the charges against them.

Timo S and Patrick F have been identified by the prosecution as alleged ringleaders and are suspected of recruiting members to the far-right cell.

F organized the explosives and S kept everyone motivated, the 19-year-old said. He also implicated Mike S, Maria K, Rico K, Sebastian W and Philipp W in the crimes.

The suspects are all local and aged between 19 and 39. Some have already been in custody since November 2015.

They face charges of forming a terrorist organization, as well as attempted murder, causing grievous bodily harm and using explosives with intent to harm.

Just two people were injured in the attacks, which took place between July and November 2015.

Federal prosecutors took over the case from state authorities in Saxony in April 2016 after they saw a case for terrorism-related charges.

Justin S, the first of the suspects to break his silence in the trial, denied intent to seriously harm anyone. "We just wanted to scare them," he said.

The young man said the group had worked together with a neo-Nazi group called the Free Comradeship of Dresden.

Dresden is the capital of the eastern state of Saxony, which has been the scene of violent clashes and anti-foreigner sentiments since almost 1 million migrants came to Germany in 2015.