MIAMI – Rapper Kodak Black has pleaded guilty to federal weapons charges.

Black entered the change of plea in Miami federal court Thursday, months after he had pleaded not guilty.

Prosecutors in May charged the 22-year-old rapper for crimes including falsifying information on federal forms to purchase three firearms. Prosecutors said a weapon purchased by Black was found at the scene of a South Florida shooting.

Authorities said he could face up to eight years in prison.

A federal judge denied his request for bond, saying he was a danger to the community based on his lengthy criminal record.

Black has remained in a federal detention center in Miami since his arrest.

The rapper also faces drug, weapons and sexual assault charges in other states. He is known for the singles "ZeZe" and "Roll in Peace."