MARTINEZ -- After five years of grand jury testimony and courtroom battles, the monthlong murder trial of an alleged East Bay jails gang leader ended Friday in a mistrial, amid allegations of juror misconduct.

Despite the ruling, Contra Costa prosecutor Tom Kensok said afterward he expects to retry Coby Phillips, who was indicted in 2008 on charges of murder, attempted murder and conspiracy to sell drugs as part of his gang, Family Affiliated Irish Mafia, or FAIM.

Throughout the trial, the courtroom was under tight security, with many prosecution witnesses under witness protection in return for their participation.

The jury alerted Judge Charles Burch on Thursday that it was hopelessly deadlocked. A juror claimed one of the 12 jurors failed to deliberate and the prosecution argued he and possibly another juror should be replaced by the alternates.

In a rare court procedure, Burch questioned all 12 jurors -- some more than once -- and determined there was no jury misconduct. He declared a mistrial.

"Two jurors were committing misconduct ... and I believe it hurt the integrity of the system to have them behave that way," said Kensok.

The veteran prosecutor said he discussed Friday's misconduct hearings with colleagues and none had ever been involved in such a case.

Phillips' attorney Daniel Horowitz argued that the jurors had strong opinions -- minority opinions leaning toward acquittal, according to juror statements -- but still followed jury instructions and participated in deliberations. Burch agreed and released the 12 jurors late Friday.