Updated

A Southern California teenager was sentenced on Monday to 21 years in state prison for killing shooting a gay student in the back of the head during a computer lab class three years ago.

Brandon McInerney, 17, didn't speak at the hearing but his lawyer Scott Wippert said his client was sorry for killing 15-year-old Larry King.

"He feels deeply remorseful and stated repeatedly if he could go back and take back what he did he would do it in a heartbeat, Wippert said.

King's family said they couldn't forgive their son's killer.

"You took upon yourself to be a bully and to hate a smaller kid, wanting to be the big man on campus,"' King's father, Greg King, said on behalf of his wife. "`You have left a big hole in my heart where Larry was and it can never be filled."'

In a deal reached with Ventura County prosecutors last month, McInerney agreed to avoid a retrial and to plead guilty to second-degree murder, as well as one count each of voluntary manslaughter and use of a firearm.

A mistrial was declared in September when jurors couldn't reach a unanimous decision on the degree of guilt. Several jurors said after McInerney's trial that he shouldn't have been tried as an adult.

Leading up to the February 2008 killing, teachers and students saw a dispute growing between King and McInerney, who shot King twice in the head in a computer lab at E.O Green Junior High School.

McInerney, then 14, had reached an emotional breaking point after King made repeated, unwanted sexual advances toward him and other boys, defense lawyers said. In the weeks leading up to the shooting, school administrators allowed King to wear heels and makeup because federal law provides the right of students to express their sexual orientation.

The case drew widespread attention because of its shocking premise and raised questions about how schools should deal with students and sexual identity issues. Comic Ellen DeGeneres, a lesbian, weighed in on her talk show shortly after the shooting and said gays shouldn't be treated as second-class citizens.

Because of pretrial publicity, the trial was moved from Ventura County to Los Angeles.

Prosecutors said the shooting in front of stunned classmates was first-degree murder and that McInerney should be punished as an adult. They argued the shooting was a hate crime, an aspect jurors rejected, after authorities found white supremacist materials in his home.

Defense attorneys, who unsuccessfully argued to keep the case in juvenile court, said it was voluntary manslaughter because McInerney lost control of his emotions. They said the teen was beaten by his father and was described as a bright student who lost his motivation.

King's father also blamed the school district for not doing more to address the brewing feud between the two teens and their son's flamboyant behavior.

"Instead of protecting him from himself and his poor impulse control, they enabled and encouraged him to become more and more provocative," Greg King said.

King's family and Deputy District Attorney Maeve Fox wore buttons with the teen's face on it, while some of McInerney's supporters wore powder blue wristbands that read "Save Brandon."

After serving nearly four years since King's slaying, with the additional 21 years McInerney will be released just before his 39th birthday.

His murder conviction will be stayed, and the plea deal calls for McInerney to be given the harshest sentence under California law for voluntary manslaughter -- 11 years -- and use of a firearm -- 10 years, prosecutors said. McInerney is ineligible for time served or good behavior because he pleaded guilty to murder.