A Ventura County judge issued the sentence a
month after Brandon McInerney agreed to plead guilty to second-degree murder and voluntary manslaughter in the death of classmate Larry King.
McInerney was shackled during the sentencing and handcuffed as he was led from the courtroom.
McInerney, who was 14 when he pulled a gun out of his backpack and shot King two times at point-blank range, will be kept behind bars until he is 39 under the terms of the deal struck by Ventura County prosecutors.
In an unusual arrangement, the 17-year-old pleaded guilty to the charges after the judge declared a mistrial in his first trial. In return, prosecutors agreed not to go forward with a second trial, which could have resulted in a life sentence.
McInerney's first trial ended in a hung jury in early September, with jurors torn between murder and manslaughter. Some jurors said they believed the district attorney's office was being overly harsh in trying McInerney as an adult and several showed up Monday wearing "Save Brandon" bracelets.
McInerney shot King in a school computer lab at E.O. Green Junior High in Oxnard in February 2008, after days of conflict between the boys. Students and teachers at the trial testified that King had been dressing in women's accessories and wearing makeup, and was flirting aggressively with male students on campus who did not want the attention.
School administrators sent a memo advising teachers to give King his space, but to report safety problems.
Teachers at the trial testified that when they tried to report growing tensions between King and several boys, school leaders shunned them.