Kodak Black has scored a legal victory.

On Friday (June 5), Kodak's attorney, Bradford Cohen, confirmed to XXL that the federal gun charges against the Florida native have been dismissed. Cohen said that he recently spoke with State Attorney Katherine Fernandez Rundle and her team, who are responsible for helping him get the charges against his client dismissed. The sentence for the felony gun charges carried a maximum sentence of 15 years in prison.

"We both felt we had positive things on each side of the case, but we didn't even discuss that," Cohen explains. "More just discussed in terms of fairness and what we thought was fair because he [Kodak] was charged federally with these same...well, it wasn't the same weapons because it wasn't a weapons charge in federal court, but it was the same nucleus of facts. Meaning, in federal court, he was charged with filling out a false form to obtain firearms and in the state case he was charged with the firearms. Because he wasn't a convicted felon, so they couldn't charge him federally for a convicted felon."

Kodak's attorney also revealed that because the rapper is being held at the maximum prison United States Penitentiary Big Sandy in Kentucky, the rapper is unable to be admitted into the prison's drug program. Last month, Kodak's attorney filed a motion to have his client removed from the facility.

"I just explained all those things to the state attorney and she was cool," Cohen continues. "She was like, listen, I wanna do the right thing. I wanna do what's fair and I think it's fair to dismiss the charges. He's already taken a plea to the federal charges. I don't want to hold him up in terms of getting help for any kind of treatment he may need and I also don't want a 22-year-old kid in a maximum security federal detention center when she doesn't believe that he belongs there."

If the charges were not dismissed, Kodak would not have been allowed to enter court-ordered drug treatment with an open case and doing time in a max security prison. By dismissing the case, he can attend drug treatment and a lower security prison.

The 2016 XXL Freshman was arrested on state and federal firearms charges in Miami just performing at Rolling Loud festival last year. Miami's WSVN News reported at the time that the ATF, Miami-Dade Police Northside Gang Unit and U.S. Marshals were all involved in Kodak's arrest.

Rolling Loud later released a statement that Kodak Black was not arrested at the festival. Instead, he was apprehended while on his way to the event.

See 10 Rappers Who Took Credit for Accomplishments They Didn't Really Earn

More From XXL