The 54-year-old, named only as Rudolf U., was set to receive a suspended sentence for fraud and not paying wage-related social security, but is now expected to be charged with murder for the attack in Dachau's civil court.
Judge Lukas Neubeck was reading out his verdict, which included a one-year suspended sentence, when Rudolf U. pulled out a pistol and fired at him, the Süddeutsche Zeitung reported on Thursday.
The judge ducked out of the way of the shot, and Rudolf U. then turned his weapon on the 31-year-old prosecutor, hitting him three times, once in the shoulder, in the arm and the stomach.
Desperate attempts to save the prosecutor, named in the German press as Tilman T., failed and he died in hospital. He is said to have studied in New York and to have been married to an American woman who moved to Germany to be with him.
Two customs officers who had been called as witnesses in the case overpowered Rudolf U. and held him until police officers arrested him, confiscating a French 6.35-millimetre calibre pistol, the paper said.
Speaking on Wednesday evening, just hours after the attack, public prosecutor Kristina Karbach said it seemed Rudolf U. had got the gun illegally. She said she would apply for a detention order for the man on suspicion of murder.
There were no security checks on Rudolf U. when he entered the court, despite what one witness said was the transport firm owner's previously aggressive behaviour.
“I knew something would happen,” the court official told the Süddeutsche Zeitung. “He had already been acting up in the hearings and was totally refusing to comply. He even had a go at his own lawyer.”
Security checks were not normal at the court, as no serious crimes are tried there, the paper said.
The generally sedate atmosphere there was turned into one of panic when Rudolf U. started firing his gun. As witnesses waiting to give evidence fled from the scene, they were joined by a number of people from the neighbouring courtroom, seen running from the building.
One shocked court assistant said he thought the gunshots heralded a massacre, and described how he ran to a nearby toilet and locked himself in.
Just a few minutes later, as Rudolf U. was being held by witnesses, armed police wearing bullet-proof vests stormed into the room and arrested him.
The Bavarian association of judges called on Wednesday night for security measures in courts to be increased.
While Bavaria's state justice minister Beate Merk said she had great sympathy for the victim and his family, she said, “absolute security cannot be achieved,” and warned against making courts into fortresses.