Cops who charged Knight with murder in a suspected hit-and-run Friday believe he meant to run his truck over a rival — rather than close pal Terry Carter — after a fight over a beef with Dr. Dre, sources said.

Knight, 49, was arrested for fatally mowing down Carter, 51, and injuring actor Cle “Bone” Sloan, 55, after visiting the Compton, Calif., set of the film “Straight Outta Compton” Thursday.

He appeared to be aiming for Sloan in a burger-joint parking lot when he put the truck in reverse and gunned it twice, TMZ reported.

The clash may have been ignited by a feud between Knight and Dre, who was filming the movie about his rap group, N.W.A, a source close to Knight told TMZ.

Knight, the source said, was trying to make amends with Dre following their infamous falling-out over Death Row Records, which they once co-owned.

But Knight got into a shoving match with Dre’s security on set before agreeing to meet the rap icon and his crew at Tam’s Burgers, the source said.

Knight drove with Carter to Tam’s, then brawled with Sloan in the lot before backing his truck over both men, witnesses told cops.

The hulking mogul fled but turned himself in to Los Angeles County police at 3 a.m. on Friday.

He was held on $2 million bail.

Knight’s attorney, James Blatt, claimed his client was fleeing for his life.

Four men were “attempting to drag him outside of the vehicle when he made an effort to escape . . . in fear for his life,” Blatt said.

“They physically punched him, grabbed him and tried to get him out of the car at the same time they threatened to kill him.”

A source close to Knight said the mogul was lured to Tam’s, led to believe he could make peace with Dre.

But he was jumped when he arrived, the source said.

In 1996, Knight was driving the car rapper Tupac Shakur was killed in. He was accused of playing a role in the death of the Notorious B.I.G. the next year. No charges were filed.

Suspects who accidently kill someone while committing another felony can be charged with murder under California law.

With Post Wire Services

Los Angeles County sheriff’s officers close the scene of the fatal accident in Compton on Thursday.AP