A police spokesman said a 47-year-old suspect was arrested.
The two men, aged 45 and 50, died of their wounds soon after the attack, which occurred at the entrance of the courthouse.
The motive for the rampage was unclear.
German news agency DPA quoted the local prosecutor's office as saying that the three had a trial date at the courthouse over a deadly stabbing of a car dealer in 2007.