The weapon was found inside a black nylon bag by technical personnel who had been called to fix a breakdown in the men's bathroom on the ground floor of the court's B Block.
Police officers then took the 7.65-diameter Italian Pietro Baretta model gun, which was loaded with 12 bullets, to the nearby police station.
The Chief Public Prosecutor's Office has opened an investigation into the case and all bathrooms of the courthouse have been searched. As part of the investigation, fingerprints on the nylon bag and the gun are being examined, along with security footage at the courthouse.
Security measures were stepped up after the incident and security personnel at courthouses began carefully searching all lawyers, judges and prosecutors with x-ray devices and metal detectors, prompting protests by judicial personnel.