A German man has been convicted of murder and given a life sentence for fatally shooting a young petrol station worker following a dispute over face masks.

The killing in the western town of Idar-Oberstein on September 18 last year shocked the country.

The 50-year-old defendant was also convicted of illegal weapons possession because he did not have a licence for the gun used in the killing, German news agency dpa reported.

Authorities have said the man told officers he acted “out of anger” after being refused service by the 20-year-old worker for not wearing a mask while trying to buy beer at the station.

A requirement to wear masks in shops was among the measures in place in Germany at the time to stop the spread of Covid-19.

Police said the suspect, a German citizen identified in local media as Mario N, left the petrol station after the dispute but returned half an hour later and shot the worker in the head.

He initially fled the scene but turned himself in to police after a large-scale manhunt was launched.

Defence lawyers in the trial at the state court in Bad Kreuznach, which lasted for six months, had sought a conviction for manslaughter.

They argued that there were limits to how far the suspect, who according to an expert was intoxicated at the time of the fatal gunshot, could be held criminally responsible for his actions.

Prosecutors had called for the court to find the defendant “seriously culpable”, which would have effectively barred him from the early release after 15 years, which is typical for people in Germany given life sentences.

Judges did not do so.