A California judge declared a mistrial Thursday in the case of a miidle school student who shot and killed a gay classmate during a morning computer lab.

Jurors deadlocked 7 to 5 in favor of voluntary manslaughter in the two-month trial, which ended after 17 hours of deliberation, the Los Angeles Times reported. The jury, which began deliberations last Friday, couldn't reach an agreement on whether to find McInerney guilty of first-degree murder, second-degree murder or manslaughter.

Brandon McInerney, 17, stood trial for the shootng of his classmate, Larry King, in an Oxnard classroom in 2008. McInerney was 14 when he walked into the computer lab at E.O. Green Junior High, pulled a .22-caliber handgun from his backpack and put the gun to King's head and pulled the trigger twice, The Times said. King was 15.

Defense attorneys had argued McInerney was defending himself against King, who they say made unwanted sexual advances toward him. Prosecutors, who claimed McInerney was motivated by hate and homophobia, must now decide whether to retry the case.

Eliza Byard, the executive director of the Gay, Lesbian and Straight Education Network, a national education organization working to ensure safe schools for all students regardless of sexual orientation, said in a statement the mistrial was hardly a surprise.

This was always destined to be a case with little resolution and no winners, whatever the verdict, said Byard, adding that homophobia killed Larry King and destroyed Brandon McInerney's life, and adults failed both young men because of their own inability to deal forthrightly and compassionately with the multiple challenges they each faced.