OAKLAND — A Sacramento man who had already been sentenced to 50 years to life in one murder case has agreed to a 21-year prison term to settle another, court records show.

Leondre Paige, 32, has pleaded no contest to manslaughter in the 2010 shooting death of 35-year-old Eric Franklin, who was killed on the 700 block of Eagle Avenue in what his co-defendant told police was a marijuana robbery. In 2015, Paige was convicted of first degree murder in the shooting death of Daniel Bradford in San Leandro, a killing Paige called self-defense at his sentencing hearing in that case.

Paige was arrested for both homicides in 2014 and has spent the past seven years in Santa Rita Jail in Dublin awaiting resolution in both cases. He was formally sentenced Aug. 12 for Franklin’s killing but remains at the jail pending transfer to state prison.

Paige and his co-defendant, Daquan Lane, were arrested in connection with Franklin’s killing in 2014. Franklin later took a plea deal for six years that was contingent on his truthful testimony, court records show.

Lane told authorities that Paige appeared to be attempting to buy marijuana from Franklin after he, Paige and a woman went bowling in Alameda that night, and that Paige “appeared dissatisfied” and shot Franklin multiple times. Lane said the group later smoked “$10 sacks” of marijuana Paige stole from Franklin, according to a motion filed by Paige’s attorney.

In the 2011 killing of Bradford, Paige was convicted of murdering Bradford after his co-defendant, Dante Clifton Burch Jr., tried and failed to buy marijuana from Bradford’s brother at a San Leandro apartment complex. Burch allegedly became angry and threatened to return with “my boys” hours before Paige showed up and shot Bradford, prosecutors said.

Like Lane, Burch agreed to testify against Paige as part of a plea deal with county prosecutors, court records show.

On the day he was sentenced to 50 years to life, Paige told a judge “I acted in self-defense,” and asked for the murder conviction to be tossed, to no avail, according to media reports.

Last month, a federal judge dismissed a habeas petition by Paige that asked for a new trial on the grounds that the prosecutor, Deputy District Attorney Butch Ford, committed multiple acts of misconduct, including “impermissibly injecting his own opinions and beliefs into evidence” by vouching for Burch’s credibility to the jury. U.S. District Judge Beth Labson Freeman rejected this argument, writing that the testimony was not prejudicial because the defense never contested that Paige was the shooter.