The 55-year-old man identified only as Rudolf U., was being given a year's suspended sentence for charges related to fraud and not paying social security contributions in January at the Bavarian court, when he pulled out a pistol and started shooting.
Initially he fired at the judge, who ducked out of the way, but Rudolf U. then turned on the prosecutor, who he hit in the shoulder, stomach and arm. Despite efforts to save him, the prosecutor, a newly married 31-year-old, died.
Harsh criticism was aimed at the court for failing to preventing him to attending his sentencing with a gun, particularly after other witnesses said he had acted aggressively before.
Rudolf U., whose financial problems were triggered by his transport company going bankrupt, has been in custody since.
He ensured parts of this latest trial were delayed by initially refusing to allow doctors to amputate his one leg, having already lost the other to diabetes. Despite the onset of septicaemia he told doctors last month he did not want treatment and would prefer to die.
In the end his second leg was also amputated and he was able to attend the Munich district court in a hospital bed. He admitted trying to kill the judge and prosecutor, but denied trying to kill his defence lawyer and the court recorder.
Although he apologized to the family of the dead prosecutor, he did not demonstrate enough regret for the Munich prosecutor, who described the shooting as a "cold-blooded murder" conducted out of "absolute selfishness."
The judge sentenced him to the maximum sentence available - 15 years - with no possibility of parole. The prosecutor warned that Rudolf U. remained a danger as he would use any opportunity left open to him to have his "revenge" against the justice system.