PALM SPRINGS, Calif. — A federal judge has said that so many wiretaps came out of Riverside County in recent years that legal standards “cannot have been met” in the nation's undisputed eavesdropping capital. Regardless, the judge allowed a single wiretap to stand in a Kentucky drug case.

The ruling comes from the first legal test of a massive eavesdropping operation that was built by county prosecutors and the Drug Enforcement Administration. Wiretaps skyrocketed in Riverside between 2010 and 2014, at which point the county accounted for nearly a fifth of all U.S. wiretaps.

District Attorney Mike Hestrin scaled back the operation last summer, slowing the flow of wiretaps out of concern that the scope of the eavesdropping had grown too extensive. But the Justice Department has defended the Riverside wiretaps in court, insisting they followed all state and federal laws.

That is hard to believe, based on the raw number of taps, said David Hall, a Kentucky U.S. District Court judge.

“While the sheer volume of wiretaps applied for and approved in Riverside County suggests that constitutional requirements cannot have been met, the legality of that system is not at issue before the court,” Hall wrote in an order issued on Friday.

Hall examined Riverside County wiretaps in the case of Chris Mattingly, an accused marijuana trafficker in Kentucky. Mattingly was arrested in 2015 after he was caught talking to suspected drug couriers on a Riverside wiretap, and his prosecution has become a landmark case for the entire eavesdropping operation, which led to hundreds of arrests nationwide. In February, Mattingly's attorneys argued the taps should be thrown out because they had come from a “rogue” county that approved “illegal wiretaps with astounding frequency.”

Eventually, the dispute boiled down to a single wiretap. In his order last week, Hall said the tap would stand, despite concerns about Riverside County overall.

Riverside County’s wiretap operation was revealed last year in a joint investigation by The Desert Sun and USA TODAY, which found taps had not only skyrocketed, but the operation almost certainly violated federal laws intended to limit the invasive power of eavesdropping. The flood of wiretaps also worried Justice Department lawyers, who privately warned the DEA that they were mostly unwilling to use the taps in court out of concern the taps would not stand up to a legal challenge.

The wiretaps had likely violated a federal law that bars the government from seeking court approval for eavesdropping unless a top prosecutor has personally signed off on that request. Congress added that requirement in the 1960s after the FBI wiretapped civil rights leaders. The only exception is when the district attorney is “absent” and has authorized someone else to act in his place.

In Riverside County, however, wiretaps were exclusively handled by lower-level attorneys. Former District Attorney Paul Zellerbach, who lost his seat to Hestrin in 2014, said he delegated approval to his assistants, and could not remember approving a single one himself.

“I didn’t have time to review all of those,” Zellerbach said last year. “No way.”

Despite that admission, challenging the legality of individual wiretaps is not so easy. In the Mattingly case, Hall ruled that defense attorneys needed to show that the individual wiretaps were illegal because Zellerbach was not absent on the day the wiretap applications were approved. The DA’s Office said it could not verify when Zellerbach was at work or absent because he kept the only copy of his calendar.

The Riverside County District Attorney's Office did not immediately respond to a request for comment.