The U.S. Department of Justice launched a civil rights investigation of the Orange County District Attorney’s Office and the Sheriff’s Department on Thursday over allegations that prosecutors and deputies withhold evidence and use jailhouse informants to illegally obtain confessions.

The investigation, announced by federal prosecutors in Los Angeles, comes after years of complaints from local defense attorneys that the district attorney and sheriff’s deputies routinely cheat in court, misuse informants and secretly tape conversations in jails to get convictions. While there have been high-profile federal investigations into police agencies, the Justice Department rarely investigates prosecutors.

In January, District Attorney Tony Rackauckas, who has denied intentional wrongdoing, wrote a letter to U.S. Attorney General Loretta Lynch saying his office would welcome a federal investigation. The office issued a statement Thursday saying it would cooperate with investigators and expects to be exonerated. …