The Death Row Records co-founder agreed to serve 28 years in prison as part of a plea deal—22 years for voluntary manslaughter and an additional six years because it is a third strike violation. He is scheduled to be sentenced Oct. 4, according to ABC News.

Knight was facing murder, attempted murder, and hit-and-run charges stemming from an incident that took place in January 2015 outside Tam’s Burgers in Compton.

The 53-year-old rap mogul got into a physical confrontation with Cle “Bone” Sloan, who was serving as a consultant on the N.W.A biopic Straight Outta Compton. Knight was reportedly upset that he was not being paid for the use of his likeness. While leaving the set, Knight hit Sloan and ran over Carter. Sloan survived, but Carter later died from his injuries.

Knight fled the scene, but the incident was captured on surveillance video. Knight initially pleaded not guilty, saying that he acted in self-defense and was fleeing armed attackers when he ran over Carter and Sloan. His legal team later claimed that a hit man hired by Dr. Dre to kill Knight was at Tam’s the day of the incident.

As part of the agreement, Knight has also been absolved in two other cases from 2014. He was accused of stealing a camera from a woman and sending threatening text messages to Straight Outta Compton director F. Gary Gray.

Knight had been facing life in prison. Jury selection for his trial was scheduled to begin Monday.