Justin Bieber did NOT get celebrity justice when he copped a plea in his Miami Beach DUI case ... because we've learned his lesser known friend who was also busted for DUI just copped a plea that is a slap on the wrist by comparison.
You may recall ... both Bieber and Khalil were busted for DUI after cops claimed they were drag racing back in January.
Sources familiar with the situation tell TMZ ... Khalil will pled guilty to careless driving and his punishment will be a $500 fine and enrollment in a drug and alcohol program.
Justin, on the other hand, pled guilty to careless driving and resisting an officer without violence. He now has to fork over $50,000 and attend 12 anger management classes ... something Khalil does have to do.
The only real difference between the 2 -- Bieber mouthed off to the cops.
Khalil's lawyer Bradford Cohen tells us, "Khalil got the benefit of being polite and courteous and not acting obnoxious and privileged, and that's why the pleas were not identical."
A $50,000 lesson learned.