SANTA ANA, Calif. (AP) — A self-styled killer at the heart of the Orange County jailhouse informant scandal has been sentenced in a plea deal that will free him in about four years.

Oscar Moriel pleaded guilty on Friday to attempted murder and was sentenced to 17 years in prison. However, he's been in custody since 2006 and will get credit for time served.

KABC-TV reports that Moriel, an informant since 2009, got the deal even though he claims to have killed a half-dozen people. On Friday, prosecutors cited his help in a crackdown on the Mexican Mafia prison gang.

Allegations that Orange County authorities routinely used snitches to illegally question people in jail have dismantled more than a dozen cases. The allegations led to mass killer Scott Dekraai avoiding the death penalty.