One of the suspects accused of murdering rapper XXXTentacion will testify against the other three in court.

Robert Allen - one of four men suspected to be involved in XXXTentacion's murder - has agreed to testify in court against his three co-defendants, Complex reports.

XXXTentacion, whose real name was Jahseh Dwayne Ricardo Onfroy, died in June 2018 after being fatally shot outside RIVA Motorsports in Florida. According to WPLG, detectives said two armed men approached a vehicle carrying the rapper, shot him multiple times, and fled the scene carrying $50,000 (£41,500).

Allen pleaded guilty on Friday in a plea deal which involved lesser charges of second-degree murder and robbery with a firearm in exchange for testimony against the other three suspects.

"Mr Allen's role in this, it was much less than the other three," his attorney Jim Lewis told NBC Miami. "More of an accessory after the fact than really part of the planning. Certainly, he never got out of the car, never had a gun, never shot anybody."

Lewis said Allen struck the plea deal "hoping for a lot better than a life sentence". The sentencing is scheduled for 23 February next year.

Michael Boatwright, Dedrick Williams, and Trayvon Newsome are all facing first-degree murder and robbery with a firearm charges. Boatwright is accused of firing the weapon that killed XXXTentacion.

Prosecutors said they believe Allen and Williams stayed inside RIVA Motorsports to watch the rapper as he perused the dealership, while Boatwright and Newsome were involved in the altercation that lead to his death.