11:36 AM PT -- Justin left the jail just moments ago ... climbing on top of an SUV and waving to a crowd of fans.
Justin Bieber was arrested for DUI early Thursday morning and it wasn't pretty -- cops say Justin was wasted and resisted arrest and cussed the cop out, dropping multiple F bombs ... TMZ has learned.
Justin posed for a smiley mug shot moments after the arrest -- while sporting a jail-issued orange jumpsuit.
Law enforcement tells us ... Bieber was busted in Miami Beach and it didn't end with DUI ... he was also busted for resisting arrest without violence, drag racing and driving on an expired license.
Law enforcement sources tell TMZ ... they believe Justin was under the influence of both drugs and alcohol.
We're told ... Justin blew a .04. That would not automatically make him a drunk driver -- IF he were 21 or older. But Justin is 19, and Florida has a zero tolerance for underage drinkers who drive. A BAC higher than .02 is ground for an automatic license suspension.
In fact, officials held a news conference and said, "[Justin] made statements he had consumed some alcohol, been smoking marijuana and consumed some prescription medication."
According to the police report -- obtained by TMZ -- cops approached Bieber's car and they instantly realized he reeked of alcohol and had bloodshot eyes. He had a "stupor" look on his face.
The police report says ... Bieber was defiant from the get-go, yelling at the cops, "Why the f**k are you doing this?" He also yelled, "What the f**k did I do. Why did you stop me?"
When the officer tried to perform a routine pat down, Bieber said, "I ain't got no f**king weapons, why do you have to search me? What the f**k is this about?" Bieber claimed he wasn't drunk and coming back from recording music. That's not true, because we knew he was at a club.
Now the basis for the resisting arrest charge -- Before the pat down, as Bieber got out of the car, he "kept going into his pants pocket." The cop ordered him to put his hands on the vehicle, and Bieber initially complied but soon took his hands off the car, turned and then cussed out the cop. The cop then grabbed Justin by the right arm, Justin pulled his arm away, and said, "What the f**k are you doing?"
The report says Justin was driving between 55 and 60 MPH in a 30 MPH residential area.
Bieber was taken into custody and transported to the police department where his blood alcohol level was tested. Our law enforcement sources say Justin was given a field sobriety test at the scene ... and failed.
His was then taken to jail where he was booked and processed.
We're told Bieber had just left SET nightclub and was driving a yellow Lamborghini at the time cops spotted him in a residential neighborhood. Our sources say Justin's people actually blocked the street off so Bieber could drag race.
Sources say the person Justin was racing was also arrested. We're told that driver was Khalil, a well-known rapper on Def Jam Records. He was in a red Ferrari.
Justin had a passenger in the car -- Chantel Jeffries -- a model, who's dated multiple celebs including an NFL superstar.
The traffic stop was for drag racing and cops determined he was driving under the influence.
The photo (below) is Chantel -- the model who was in Justin's yellow Lambo -- and Justin. The pic was NOT taken at the time of the arrest.
TOO COOL FOR SCHOOL
During Court Appearance
Justin Bieber made a point of showing off his tattoos and his muscles during his court appearance Thursday in Miami Beach.
Bieber appeared via closed circuit TV as the judge set bond in his DUI/resisting arrest/driving on a suspended license case.
Check out how Bieber rolled up his jumpsuit sleeves. He let his arms do the talking because he said nothing as the judge set bail at $2,500 ... which we're guessing he can afford.
It's not exactly a capital offense, but Bieber hired the best ... attorney Roy Black, who helped William Kennedy Smith beat the rape rap. He's also repped Rush Limbaugh and Kelsey Grammer.
Bieber should post bail soon.