A Mongols motorcycle gang member who killed a Pomona SWAT officer during a crackdown on the group eight years ago has pleaded no contest to voluntary manslaughter after twice being acquitted of murder.

David Martinez had been found not guilty in two separate murder trials over the shooting of Officer Shaun Diamond during the October 2014 raid on his home.

Martinez, 44, testified he did not know it was the police outside when he opened fire, telling one of the juries he was sure it was members of the Mongols coming for him.

Last month, jurors in the most recent trial deadlocked on two lesser charges of voluntary manslaughter and assault with a firearm. On Wednesday, Martinez opted to plead no contest to both charges, the Los Angeles Times reported. He is scheduled to be sentenced Jan. 17.

Because he has served more than eight years, defense attorneys are hoping he will be released given time he’s already served. But prosecutors are expected to seek a higher sentence, according to the Times.

Prosecutors said Martinez fired a shotgun once and struck Diamond in the back of the head as the officer helped serve a search warrant in suburban San Gabriel.

Diamond, a 19-year law enforcement veteran, was taking part in a multi-agency operation targeting the Mongols.