One of the hardest-fought crime bills of the legislative session, stiffening the laws against prosecutors who withhold evidence that might help the defense, has been vetoed by Gov. Jerry Brown.

AB885 by Assemblyman Tom Ammiano, D-San Francisco, applied to cases in which the defense learns, before the end of the trial, that the prosecution has deliberately violated its legal duty to disclose evidence potentially favorable to the defendant. Under current law, the judge might grant a brief delay to allow the defense to look into the evidence, can hold the prosecutor in contempt, and can also mention the lapse to the jury. Ammiano’s bill would have required the judge to tell jurors the evidence was intentionally withheld and that they can consider the non-disclosure as a possible sign that the prosecution was unable to prove its case.

The bill cleared both houses over strong opposition from district attorneys, who said the current law provides adequate sanctions for violations of the rules of discovery, the exchange of evidence that takes place before trial. Brown agreed in his veto message Sunday.

“Prosecutorial misconduct should never be tolerated,” the governor said. But he said AB885 “would be a sharp departure from the current practice that looks to the judiciary to decide how juries should be instructed. Under current law, judges have an array of remedies at their disposal if a discovery violation comes to light during trial.”

Ammiano, whose legislative career is about to end because of term limits, said he was angered by the veto. He cited cases in which innocent defendants have been locked up for many years because prosecutors had withheld evidence.

“We need this bill to stop the few prosecutors whose zeal for convictions lead them to cut corners on justice,” Ammiano said.

Brown also vetoed another bill opposed by police and prosecutors, one that would have required officers to get a warrant from a judge before using drones in a search, except in an emergency. The governor said AB1327 by Assemblyman Jeff Gorell, R-Camarillo (Ventura County), was too restrictive.

It’s the fourth time Brown has vetoed legislation requiring warrants for police searches. One bill would have required judicial approval for searches of cell phones officers seize from people they arrest — a bill that effectively became law, despite Brown’s veto, when the U.S. Supreme Court ruled this June that the Constitution required warrants for those searches. The other two measures Brown rejected would have required a warrant when police use private cell phone information to track someone’s location, and when they obtain e-mails and other electronic information from Internet service providers who have held the records for more than 180 days. Federal law requires warrants when the recoreds have been held for 180 days or less.

Brown signed one significant bill Sunday, however, that prosecutors and police had opposed. SB1010 by Sen. Holly Mitchell, D-Los Angeles, will equalize sentencing for crack and powder cocaine by reducing the terms for possession of crack with intent to sell from three to five years in prison to two to four years.

The issue has racial implications — crack defendants are disproportionately black, and powder cocaine defendants are mostly white. Civil rights and criminal defense groups supported Mitchell’s bill, but prosecutors and police groups argued that the sentences should be equalized by increasing terms for powder cocaine.