Kodak Black will spend the next 46 months in prison on federal weapons charges.

The “ZEZE” rapper appeared in court Wednesday morning (Nov. 13) to be sentenced for federal firearms charges related to his May 11th arrest.

The Miami Herald reports that a federal judge sentenced the rapper to 3 years and 10 months in prison as a part of a plea deal he took back in August … a far cry from the 8-10 years he was facing.

The 22-year-old admitted to lying on federal forms when he purchased firearms from a Miami-area gun shop on two separate occasions.

Prosecutors said one of the guns illegally purchased by Kodak was found at the scene of a Florida shooting.

The gun, which had a live round in the chamber and Black’s fingerprints on it, had been fired at two homes, including one with children inside.

“A rival rap artist was the intended target,” Assistant U.S. Attorney Bruce Brown wrote in court docs filed to keep Black behind bars.

A second handgun Kodak illegally purchased was found in the trunk of Porsche Panamera that was a part of the rapper’s convoy while crossing the Canada-United States border back in April.

Kodak, who was riding in another vehicle, was found with eight grams of marijuana. He was charged with criminal possession of a firearm and unlawful possession of marijuana at the time.

Kodak was taken into federal custody in Miami the following month when he arrived to perform at Rolling Loud.

Kodak also ran into a bit of trouble behind bars while awaiting sentencing.

Prosecutors reportedly recommended the rapper receive an 8-year sentence after it was revealed that he was involved in a prison fight that sent a guard to the hospital.

It was reported that Kodak injured a correctional officer’s groin when the guard tried to break up the fight between Kodak and another inmate. The guard reportedly required surgery after Kodak allegedly grabbed his testicles and wouldn’t let go.