A Florida judge on Tuesday ordered rapper Kodak Black to attend a drug rehab program for 30 days after he allegedly tested positive for fentanyl, in violation of the terms of his bail.

Broward County Judge Barbara Duffy said the artist, whose real name is Bill Kapri, could remain free until March 7, allowing him to perform at the Rolling Loud music festival near Los Angeles over the weekend. of week. NBC South Florida informed.

The 25-year-old artist’s attorney, Bradford Cohen, suggested the artist’s sample or paperwork might have been mixed up with someone else’s, the outlet reported.

Cohen’s office did not immediately respond to a request for comment from NBC News Wednesday morning.

Kodak Black failed to appear for a drug test scheduled on February 3 before taking one on February 8, which tested positive for fentanyl, according to the Broward County Sheriff’s Office.

The “Super Gremlin” artist had been out on bail in a drug case.

Avoid illegal drugs and negative test were the conditions of his pretrial release in a case alleging he trafficked oxycodone.

Florida Highway Patrol officers said they found 31 oxycodone pills in his car after he was pulled over in July for possible illegal window tinting.

Kodak Black, whose residence is listed as Miramar, Florida, pleaded not guilty.

The artist has been under close police scrutiny in recent years.

He was arrested on burglary charges in the Pompano Beach, Florida area on New Year’s Day 2022, in a case that prosecutors refused to pursue.

Weeks later, he was wounded in a shooting outside a Los Angeles nightclub. Black’s attorney, Bradford Cohen, said his client was shot in the leg while helping someone who was the target of an unprovoked attack.

In 2019, Black was sentenced to 3 1/2 years in federal prison for providing false information to the government regarding required firearms documentation. In 2020, the then president Donald Trump commuted the rest of your sentence with about half remaining.