VENTURA (CBS) — A plea deal has been reached for an Oxnard teenager accused of killing a gay classmate.

READ MORE: Strike Averted: IATSE And AMPTP Have 'Basic Contract' Agreement, Per Officials With The Theatrical Stage Employees Union

Brandon McInerney, now 17, agreed to the deal Monday afternoon, pleading guilty to second degree murder, manslaughter and use of a firearm.

McInerney is accused in the 2008 murder of 15-year-old Larry King at E.O. Green Middle School.

According to the terms of the plea deal, McInerney will be sentenced to 21 years in prison, which will not include time already served.

He will be sentenced on Dec. 19.

“This gives us a full 25 years in custody,” says assistant district attorney, Mike Frawley. “We’ve protected the community.”

READ MORE: Taylor's Blunder, Other Missed Chances Put LA In NLCS Hole

McInerney had previously rejected an offer of 25 years to life for first degree murder and a hate crime.

McInerney’s attorney Scott Wippert says his client has been remorseful since the beginning.

“If he could take it back, obviously every day he thinks and wishes that he could,” says Wippert. “At this point I think he’s relieved.”

A judge declared a mistrial in September of this year when jurors deadlocked; seven jurors wanted to convict McInerney of manslaughter, five wanted him convicted of murder.

A retrial was scheduled to begin Monday. McInerney was being charged as an adult, which could have brought a life sentence.

Larry King’s father, Greg King, says the family is relieved they will not have to endure another trial.

MORE NEWS: Karen Bass Officially Kicks Off Her Run For Mayor Of Los Angeles At Saturday Event

“It’s a little bit bittersweet,” says King. “I don’t think that 21 years is really justice for cold blooded murder. But on the other hand, we’ve been going through this for four years, and at least there’s some closure coming up.”