Play video content Exclusive Details TMZ.com

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.

Play video content

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.

JUSTIN BIEBER

TOO COOL FOR SCHOOL

During Court Appearance

Play video content

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.