Flo Rida just scored big in his DUI case -- TMZ has learned, the rapper struck a sweet deal with prosecutors that will land him in a classroom ... rather than a jail cell.
As TMZ first reported ... Flo -- real name Tramar Dillard -- was busted in Miami Beach back in June on suspicion of DUI inside his million-dollar Bugatti. At the time, cops said Flo's blood alcohol level was .185 ... more than twice the legal limit.
But an attorney for Mr. Rida was in court today -- and got the judge to send Flo to a first-time offenders program instead of the slammer ... a thing called "Back on Track," which entails a bunch of stuff like substance abuse classes, counseling, community service, and drug testing.
Under the deal ... if Flo completes all the program requirements, prosecutors will knock the DUI charge down to a lesser charge -- reckless driving. Not bad.