A German man accused of killing two people in one of the worst acts of anti-Semitic violence in post-war Germany sought to lay out his racist world view at the opening of his trial on Tuesday, prompting stern warnings from the judge.

Stephan Balliet, 28, stands accused of shooting dead two people last October after he tried and failed to storm a synagogue in the eastern city of Halle last year.

He has been charged with two counts of murder and multiple counts of attempted murder in a case that has deeply rattled the country and fuelled alarm about rising right-wing extremism and anti-Jewish violence, 75 years after the end of the Nazi era.

Addressing the court, Balliet claimed he had "decided in 2015 not to do anything more for this society which has replaced me with Muslims and negroes", in reference to the year when hundreds of thousands asylum seekers, many fleeing war in Syria and Iraq, were given refuge in Germany.

Judge Ursula Mertens repeatedly called him to order, warning that he could be thrown out of the hearing.

Balliet was brought handcuffed into the courtroom by armed guards
Balliet was brought handcuffed into the courtroom by armed guards POOL / RONNY HARTMANN

"I have the possibility to exclude you from the proceedings. I will not tolerate you committing crimes and insulting people in this courtroom."

Undeterred, Balliet sought to put forward his racist ideas, claiming he had "no problems with religions but with Semitism".

In response to calls for the trial not to become a platform for the accused to spout his hatred, a spokesman for the Magdeburg district court said "at no time can one think that the court shared the view of the accused".

Dressed in black, Balliet was brought handcuffed into the courtroom by three armed guards. He looked directly at the waiting cameras as he removed the face mask he was wearing because of the coronavirus pandemic.

Prosecutors say Balliet used explosives and firearms to try to gain access to the synagogue, where 52 worshippers were celebrating Yom Kippur, the holiest day in the Jewish calendar.

Balliet has been charged with two counts of murder and multiple counts of attempted murder
Balliet has been charged with two counts of murder and multiple counts of attempted murder POOL / Hendrik Schmidt

After failing to break through the synagogue's locked wooden door, he shot dead a female passer-by and a man in a nearby kebab shop.

Balliet apologised for killing both German nationals, saying he had only shot dead the man because he thought he was Muslim.

He filmed the assault and livestreamed it on the internet.

Balliet told the court he had been inspired by a gunman's 2019 attack on Christchurch mosques in New Zealand, which killed 51 Muslim worshippers.

The synagogue in Halle which Stephan Balliet is accused of trying to storm with firearms and explosives during a Yom Kippur ceremony.
The synagogue in Halle which Stephan Balliet is accused of trying to storm with firearms and explosives during a Yom Kippur ceremony. AFP / JENS SCHLUETER

Ahead of the trial, prosecutors said Balliet had made a "very comprehensive" confession, confirming "far-right and anti-Semitic motives".

Balliet also published documents online that called for the killing of all Jews.

His video of the attack will be shown in court. Balliet faces an additional charge of incitement to hatred for denying the Holocaust in the footage.

Mark Lupschitz, the lawyer representing nine worshippers at the synagogue at the time of the attack, said his clients "want answers and want to look him in the eyes to let him know that they have no understanding for what he did."

According to a report in the Spiegel magazine, a psychologist assessment deemed him to be aware of his actions and not exempt from criminal responsibility.

If convicted, Balliet could face life in prison.

The synagogue's heavy wooden door still bears the bullet holes from the assault and will soon be removed and used for a communal art project.

President Frank-Walter Steinmeier said in his Christmas speech last December that it was "a miracle" the door had resisted the attack, saving dozens of lives.

"It also symbolises what we stand for. Are we strong and resistant? Do we stand by each other enough?" he asked.

The Halle attack came three months after the murder of local pro-migrant politician Walter Luebcke in the western city of Kassel, allegedly by a known neo-Nazi.

In February this year, a gunman with apparent far-right beliefs killed nine people at a shisha bar and a cafe in the city of Hanau, near Frankfurt.

Interior Minister Horst Seehofer has since declared far-right extremism the "biggest security threat facing Germany", promising a beefed-up security response.