The judge Astrit Kalaja led the negotiations when a shooting suddenly broke out.
Kalaja was loaded into an ambulance, but died on the way to the hospital. The suspect was arrested shortly after the incident.
Two plaintiffs were also hit, but their condition is not considered life-threatening.
According to local media, the trial concerned a property dispute.