Former rap mogul Marion “Suge” Knight has pleaded no contest to voluntary manslaughter after he ran over two men, killing one, nearly four years ago.

The Death Row Records co-founder entered the plea on Thursday in Los Angeles Superior Court and has agreed to serve 28 years in prison.

Knight was charged with murder, attempted murder and hit-and-run after fleeing the scene of an altercation in January 2015 outside a Compton burger stand.

Knight and a consultant on the NWA biopic Straight Outta Compton were involved in a fistfight that ended with Knight clipping the man with his pick-up truck and running over businessman Terry Carter, who died from his injuries.

Knight’s lawyers have said he was acting in self-defence and was fleeing armed attackers when he ran over Carter and Sloan.

During Thursday’s hearing, Knight answered Judge Ronald Coen’s questions, loudly and quickly saying “no contest” when the judge asked for his plea.

The plea deal calls for Knight to serve 22 years in prison on the voluntary manslaughter count, and another six years because it is a third strike violation.

Knight, 53, was a key player in the gangster rap scene that flourished in the 1990s, and his label once listed Dr Dre, Tupac Shakur and Snoop Dogg among its artists.

Knight lost control of the company after it was forced into bankruptcy.

He has prior convictions for armed robbery and assault with a gun. He pleaded no contest in 1995 and was sentenced to five years’ probation for assaulting two rap entertainers at a Hollywood recording studio in 1992.

He was sentenced in February 1997 to prison for violating terms of that probation by taking part in a fight at a Las Vegas hotel hours before Shakur was fatally wounded in a drive-by attack as he rode in Knight’s car just east of the Las Vegas Strip.

Shakur’s killing remains unsolved.

He had faced life in prison if convicted of murder for killing Carter.