Law enforcement tells us … Bieber was busted in Miami Beach and it didn’t end with DUI … he was also busted for drag racing.

The arrest occurred early Thursday morning.

Bieber is now in custody and is at the police department where he is being tested — presumably to more precisely measure his blood alcohol level. Our law enforcement sources say Justin was given a field sobriety test at the scene … and failed.

His next stop will be jail, where he will be booked and processed and bail will be set.

We’re told Bieber had just left a club and was driving a yellow Lamborghini at the time cops spotted him in a residential neighborhood. Sources say the person Justin was racing was also arrested — he was in a red Lambo.

Justin had a passenger in the car — a model.

Based on what we know … the traffic stop was for drag racing and cops determined he was driving under the influence.

Ironically, we doubt that this arrest will sober the Biebs up.

Flip it over to see pics of Bieber and his whips at the club just before he caught his charge