SACRAMENTO, Calif. (AP) — Many California courts fail to tell state justice officials when someone is determined to be mentally ill, undermining efforts to take guns away from potentially dangerous owners, according to a state audit released Tuesday.

State law requires courts to tell the Department of Justice when it makes certain mental health determinations.

The department uses that information as part of a program unique to California that seizes guns from people who are prohibited from having them, including the mentally ill.

Auditors discovered that many courts were not aware of the reporting requirements.

They surveyed 34 of California's 58 superior courts and found that only five knew of the law. The 34 courts collectively failed to report at least 2,300 mental health determinations over a three-year period ending in 2012.

Other courts only reported some of the information required by law.

The audit said San Bernardino County failed to report all 15 cases involving defendants deemed mentally incompetent to stand trial. Los Angeles County Superior Court failed to report nearly half the 27 cases reviewed by auditors, while Santa Clara County's largest courthouse made just nine of 15 required reports.

Courts are required to report the information immediately, but auditors found some took up to seven days. They recommended that state law be changed to require reporting within 24 hours.

Meanwhile, Justice Department officials failed to remind courts of their responsibility, even when they knew reports were missing.

The department also failed to keep proper track of mental health facilities that also are required to report problems, and employees' judgments on who should be prohibited from owning firearms were sometimes flawed. Of eight decisions reviewed by auditors, three were incorrect.