Rapper Kodak Black was sentenced Wednesday to more than three years in federal prison after pleading guilty to weapons charges stemming from his arrest just before a scheduled concert performance in May.

The 22-year-old Black admitted in August that he falsified information on federal forms to buy four firearms from a Miami-area gun shop on two separate occasions.

Black was able to obtain three of the weapons: a 9 mm handgun, a .380-caliber handgun and a semi-automatic Mini Draco weapon. Authorities said one of the guns was found at the scene of a March shooting in Pompano Beach, although he has not been charged in that case.

RAPPER KODAK BLACK ARRESTED IN UPSTATE NEW YORK

Black also faces drug, weapons and sexual assault charges in other states that remain pending. He has had several previous arrests.

This Jan. 18, 2018 file arrest photo provided by the Broward County Sheriff's Office, Fla., shows Dieuson Octave, also known as the rapper Kodak Black. (Broward County Sheriff's Office via AP, File)

U.S. District Judge Federico Moreno could have sentenced Black to the maximum of 10 years, and prosecutors wanted eight years in part because Black allegedly was involved in a jail fight that injured a corrections officer.

“I think it’s time for us to give some tough love in this case,” said Assistant U.S. Attorney Bruce Brown. “I just don’t see how and when he’s taken these things seriously.”

RAPPER KODAK BLACK PLEADS NOT GUILTY TO WEAPONS CHARGES

But Moreno noted that Black has given money anonymously to charitable causes and could continue to do so behind bars.

“My suggestion would be you continue to be generous,” the judge said.

Black is a Florida native who was born to Haitian American parents as Dieuson Octave and who now goes by the legal name of Bill Kapri.

KODAK BLACK ARRESTED, LIL WAYNE SEARCHED BY POLICE AT ROLLING LOUD MUSIC FESTIVAL

In this Aug. 27, 2017 file photo, Kodak Black arrives at the MTV Video Music Awards in Inglewood, Calif. The rapper has been sentenced to more than three years in federal prison after pleading guilty to weapons charges stemming from his arrest just before a scheduled concert performance in May. The 22-year-old admitted in August that he falsified information on federal forms to buy four firearms from a Miami-area gun shop on two separate occasions. (Photo by Jordan Strauss/Invision/AP, File) (Jordan Strauss/Invision/AP, File)

He was arrested during the Rolling Loud hip-hop festival in May that was marred by several violent incidents, including an unrelated shooting at a seaside property owned by President Donald Trump. Black has remained in custody since then his arrest.

CLICK HERE TO GET THE FOX NEWS APP

“I have made some decisions I’m not proud of making,” Black said in court. “I do take full responsibility for my mishap.”

Black's better-known singles include "Skrt," ''Zeze", "Roll in Peace", "Tunnel Vision", and "No Flockin."