Updated

Rapper Kodak Black plead guilty Thursday to federal weapons charges related to his arrest before a performance at a Miami-area hip hop festival in May.

The decision comes months after an original plea of innocence. Prosecutors charged the 21-year-old Miami-based rapper for crimes that involve falsifying information on federal forms to purchase three firearms: a 9 mm handgun, a .380-caliber handgun and a semi-automatic Mini Draco weapon.

KODAK BLACK TO REMAIN JAILED UNTIL TRIAL ON FEDERAL WEAPONS CHARGES

Prosecutors say one of the weapons purchased by Black was found at the scene of a Pompano Beach shooting.

FILE - In this Aug. 27, 2017 file photo, Kodak Black arrives at the MTV Video Music Awards at The Forum in Inglewood, Calif. Officials say Florida rapper Kodak Black was arrested on federal and state weapons charges just before he was to perform at a hip-hop festival. The U.S. Marshals office says in a news release that the 21-year-old Black was taken into custody Saturday, May 11, 2019 at the Rolling Loud Music Festival at Hard Rock Stadium in Miami Gardens. The statement didn’t elaborate.(Photo by Jordan Strauss/Invision/AP, File)

Kodak Black arrives at the MTV Video Music Awards at The Forum in Inglewood, Calif. Officials say Florida rapper Kodak Black was arrested on federal and state weapons charges just before he was to perform at a hip-hop festival. The U.S. Marshals office says in a news release that the 21-year-old Black was taken into custody Saturday, May 11, 2019 at the Rolling Loud Music Festival at Hard Rock Stadium in Miami Gardens. The statement didn’t elaborate. (AP)

A federal judge denied his request for bond saying he was “danger to the community” based on his lengthy criminal record. Black has remained in a federal detention center in Miami since his arrest.

The music festival he was scheduled to perform at was marred by several violent incidents. Investigators are investigating three unrelated shootings with possible connections to the festival, one of which involved property owned by President Donald Trump.

When U.S. District Judge Federico Moreno asked Black why he needed so many weapons, he shrugged and said he needed them for “protection.” In a previous hearing, his attorney, Bradford Cohen, said the rapper faced threats from gangs and other rivals.

Authorities say he could face up to 20 years in prison and a $500,00 fine.

CLICK HERE TO GET THE FOX NEWS APP

The rapper, known for singles “ZeZe” and “Roll in Peace,” also faces drug, weapons and sexual assault charges in other states.

The Associated Press contributed to this report.