The sheriff's department confirmed to the L.A. Times that the shooting took place in the Van Nuys' courthouse on Aug. 16 at the Van Nuys Courthouse.
A department spokeswoman declined to detail the circumstances of the shooting or say if anyone was injured.
News of the shooting was first made public by the advocacy group Court Watch LA. The group says the gun went off while the courtroom was filled with attorneys and clients waiting to have their cases heard.
The Associated Press contributed to this report.