The deal means Brandon McInerney will be 38 before he is free, the Los Angeles Times reported. McInerney has been behind bars for almost four years.
McInerney, of Oxnard, shot Larry King -- who was 15 at the time -- after bringing a handgun to school Feb. 12, 2008.
Jurors in his trial were split on finding McInerney guilty of murder or voluntary manslaughter. During the trial, prosecutors argued McInerney was motivated by homophobic rage, while the defense described him as a troubled teen who went over the edge after King made sexual advances.
Teachers testified King's behavior had caused tension in school.
Both King's father and gay rights groups suggested the plea bargain was appropriate.
"Larry had a complicated life, but he did not deserve to be murdered," Greg King, said after a court hearing Monday.