11:42 AM PT -- According to the plea agreement -- obtained by TMZ -- prosecutors say they'll push for a lighter sentence than the maximum because Kodak has been cooperative.

11:28 AM PT -- Kodak pled guilty to 2 counts of knowingly making a false and fictitious written statement in connection with the acquisition of a firearm. He faces a maximum of 10 years in prison followed by 3 years of supervised release.

Kodak Black[1] just did an about-face and cut a deal in his federal firearms case.

The rapper was in court Thursday for a change of plea hearing where he told the judge he was now pleading guilty ... after initially pleading not guilty to lying on federal gun applications.

Kodak has been in federal detention since his arrest in May -- the judge denied his request to be released on bond, calling him a danger to the community[2]. His sentencing is now set for November 13, and he could get several years in prison.

As we reported ... Kodak was busted at the Rolling Loud[3] festival, when officers had warrants for his arrest after he'd been indicted on the false statement charges.

Kodak's alleged firearm application lie ... is that he was NOT under any indictment for a crime that could land him behind bars for over a year.

Of course, the rapper IS in the middle of a very serious criminal case -- he was indicted[4] for allegedly sexually assaulting a teenage girl in 2016 at a hotel in South Carolina.

Read more from our friends at TMZ