Flo Rida just scored big in his DUI case –, the rapper struck a deal with prosecutors that will land him in a classroom, rather than a jail cell.

As 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 jail,  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.