A German neo-Nazi went on trial Tuesday for the 2019 murder of a pro-refugee politician, with the court hearing that he allegedly began plotting the killing after the 2016 Islamist truck attack in Nice fuelled his hatred of foreigners.

Walter Luebcke, 65, was shot dead while sitting in his garden last June, in a case that shocked Germany and stoked alarm about rising far-right violence.

Federal prosecutors say the main suspect, 46-year-old Stephan Ernst, was motivated by "extreme right-wing political convictions" when he pulled the trigger.

Ernst appeared at the higher regional court in Frankfurt alongside co-defendant Markus Hartmann, who stands accused of helping him train with firearms -- including the murder weapon.

Luebcke's killing is believed to be Germany's first far-right political assassination since World War II.

The first day of the trial drew huge interest from the public and media but seating in court was limited because of coronavirus social distancing rules.

Both defendants wore face masks as they were led into the courtroom, where plexiglass screens were installed to curb the spread of COVID-19.

Ernst admitted to the homicide shortly after his arrest but later retracted his confession and said Hartmann fired the gun.

The words 'Human dignity is inviolable' stand above the entrance to a court room at the Higher Regional Court in Frankfurt, where Stephan Ernst will stand trial
The words 'Human dignity is inviolable' stand above the entrance to a court room at the Higher Regional Court in Frankfurt, where Stephan Ernst will stand trial AFP / THOMAS KIENZLE

Hartmann's lawyers however told judges that their client "had nothing to do with the crime".

Prosecutors agree that Hartmann "was not aware of Ernst's plans" but believe he readily accepted that Ernst could use his weapons training "to kill a person", according to the indictment read out in court.

Luebcke's widow and his two adult sons attended the opening hearing.

"The family wants to send a clear signal against hatred and violence," their spokesman Dirk Metz told reporters.

Luebcke belonged to Chancellor Angela Merkel's conservative CDU party and headed the Kassel regional council in the western state of Hesse.

He supported Merkel's 2015 decision to open the country's borders to refugees, with more than one million arriving since then, and spoke in favour of hosting asylum seekers in a local town.

There was a heavy security presence at the court
There was a heavy security presence at the court AFP / THOMAS KIENZLE

Prosecutors say Ernst and his accomplice attended a speech by Luebcke in October 2015 when the politician defended helping refugees, adding that anyone who did not agree with those values was "free to leave the country".

The remark was widely shared online and turned Luebcke into a hate figure for the far right.

After the speech, Ernst "increasingly projected his hatred of foreigners" on to Luebcke, according to the indictment.

Angered by mass sexual assaults by migrants against women in Cologne on New Year's Eve 2015 and the 2016 terror attack in the French city of Nice, Ernst "began planning the murder in earnest" and started tracking Luebcke's movements, the indictment said.

Between 2016 and 2018, prosecutors say Ernst worked with Hartmann to improve his skill with firearms, and the two attended right-wing demonstrations together.

In the course of their investigations, prosecutors separately charged Ernst with attempted murder for allegedly stabbing an Iraqi asylum seeker in the back in 2016.

Ernst has a long criminal history and was known to police as a neo-Nazi sympathiser.

He was convicted of an attempted bomb attack on an asylum home in 1993. In 2009, German media say he took part in neo-Nazi clashes targeting a union demonstration.

But Ernst then slipped off the security services' radar, leading to criticism that the authorities were not taking the far-right threat seriously enough.

German police came under fire years earlier for overlooking racist crimes after it emerged that a neo-Nazi terror cell, the National Socialist Underground, had killed 10 people, mainly immigrants, between 2000 in 2007.

In October 2019, just months after Luebcke's death, Germany was rocked by a shooting at a synagogue in the eastern city of Halle that left two dead. The suspect later admitted to anti-Semitic and far-right motives.

Last February, another gunman shot dead nine people of migrant origin in the central town of Hanau.

Interior Minister Horst Seehofer recently declared far-right extremism the "biggest security threat facing Germany".

He has promised tougher security measures, including a crackdown on online hate speech.