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

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

READ MORE: Local Firefighters Begin 9/11 Memorial Ride Cross-Country

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.”

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

READ MORE: 2 Killed In Crash On 110 Freeway in South LA

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: Man Fatally Shot In Lancaster; Probe Underway

“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.”