Kodak Black attacked a prison guard behind bars, but he claims it was all a setup.

Sources close to the rapper tell TMZ that last month’s fight at Miami’s Federal Detention Center was started after someone slipped something in Kodak’s drink.

Surveillance video shows Kodak drinking a cup of coffee about 20 minutes before attacking a fellow inmate. His reps believe the coffee was spiked with a chemical substance intended to make him lose control.

An FBI agent testified Wednesday that witnesses said Kodak appeared to be under the influence when the fight broke out. Kodak allegedly grabbed the corrections officer’s testicles before he was sprayed with mace. It took several prison guards to restrain Kodak, who showed incredible strength. The staff member was taken to a hospital to undergo surgery.

Black’s reps don’t know who drugged him, but apparently there are several people who want to see him remain behind bars. Kodak’s attorney, Bradford Cohen, is currently investigating the fight.

On Wednesday, the 22-year-old rapper was sentenced to 46 months in prison on weapons charges, which is considerably less than the maximum 10-year sentence he was facing.

Before his sentence was handed down, Kodak accepted responsibility for his crimes. “I’m sorry for the actions that led me for where I’m standing,” he said. “I do take full responsibility for my mishap.”