The Munich resident who hurled insults at shooter Ali David Sonboly as he was carrying out an attack on a shopping mall has been accused of libel, the Munich prosecutor has announced.

Thomas Salbey became an internet sensation after footage of him hurling abuse at Sonboly, from the balcony of his fifth floor apartment was posted on Twitter.

But while many praised Mr. Salbey for standing up to the gunman – who aimed shots in his direction – Florian Weinzierl, a spokesman for the Munich prosecutor, has confirmed that Mr. Salbey is to be charged with libel for his comments. It is not known who reported Mr. Salbey to the authorities.

As the attack by Sonboly was already underway, Mr. Weinzierl said that initial investigations have shown that Mr. Salbey’s diatribe did not affect the course of events. The specific charges have yet to be announced, but Mr. Weinzierl said he expected that they would include “insults to the detriment of the dead”.

A court review is expected to be completed shortly.

During the attack, as Sonboly took shelter in a carpark above a mall, moments after gunning down nine people and injuring 16 others, Mr. Salbey threw a bottle at him to try to stall him.

The two argued, with Mr. Salbey repeatedly calling Sonboly a “wanker” and asking “what the fuck you think you’re doing?”

Sonboly claimed: “Because of you I was bullied for 7 years and now I have to buy a gun to shoot you.”

Mr. Salbey replied: “A gun? Fuck off”.

The gunman later committed suicide by shooting himself, about a kilometre away from the site of the attack.

The charges against Mr. Salbey, for which he is expected to have to pay a fine, will likely raise tensions in Germany further. More than 2,000 people turned out in Dresden on Monday night to take part in the latest march organised by Patriotic Europeans Against the Islamisation of the West (PEGIDA) movement.

Protesters held German flags and banners reading “No more solidarity – it is Bullsh*t!”, “Kick throat cutting terrorists and Islamist crowd out of Germany!”, and “Merkel Must Go!”