MIAMI — After allegedly smoking pot all day, drinking beer and popping anti-depressants, bad-boy pop star Justin Bieber went on a wild predawn drag race in Miami Beach that landed him in jail Thursday morning, police said.

When stopped in his yellow Lamborghini, Bieber barraged officers with a string of F-bombs, babbled incoherently, refused to get out of his car and, when he finally stepped out, declined to take his hands out of his pockets, according to the police report.

He was booked at Miami Beach Police headquarters on charges of DUI, resisting arrest and drag-racing, a police spokesman said. The musician’s entourage had apparently used their cars to block traffic on Pine Tree Drive at 26th Street, near the Miami Beach Hebrew Academy and Scott Rakow Youth Center, at 4:30 a.m., creating a drag strip for the young star — who had been on a party spree all week in South Florida.

Bieber was booked into jail and had a court appearance on Thursday afternoon at Miami-Dade Circuit Court. Mega-lawyer Roy Black represented him.

Bieber appeared briefly in front of Judge Joseph Farina, via video, clad in red jail-issued scrubs. Bond was set at $2,500.

Roadside sobriety tests showed that Bieber was under the influence of drugs, Miami Beach Police Chief Raymond Martinez told the Miami Herald. He declined to comment further, but a police source said Bieber admitted he had been smoking marijuana and taking prescription anti-depressants and had a beer or two.

The police report said that Bieber was flushed, was in a stupor, smelled of alcohol and was incoherent. He failed a field sobriety test.

Police said Bieber was uncooperative and kept fumbling his hands in his pockets and, even after he was asked to place his hands on the car in front of him, kept turning around and confronting the officer, who attempted to pat the singer down for weapons.

Finally, after several warnings, the officer placed him in handcuffs.

The other driver, identified as a Sacramento, Calif.-based R&B singer named Khalil Sharief, was charged with DUI, said police spokeswoman Vivian Hernandez. His bond was set at $1,000.

“It was a cold night, and it was quiet, so the officers could hear the cars,” Chief Martinez said, adding that patrols followed the sound of the revving engines. “When the cars are going that fast, it takes a while to catch up.”

According to law enforcement sources, Bieber’s breath test did not show any substantive alcohol use. He blew .014 and .011, well below the legal limit That amount is too low for state authorities to even suspend a license for an underage driver, although Bieber does not have a Florida license.

But authorities consider the case against Bieber to be strong. In addition to admitting to the use of intoxicants, Bieber did not pass a roadside sobriety test. “He failed miserably,” said one law enforcement source.

A police officer certified as a “Drug Recognition Expert” also evaluated Bieber — and concluded he was driving under the influence of a controlled substance.

Normally, for first-time DUI offenders, the Miami-Dade state attorney’s office offers a diversion program in which prosecutors drop the DUI charge in exchange for heavy fines, classes and community service.

But the program has a strict criteria — and Bieber would likely not be eligible because he is accused of drag racing in a residential neighborhood.

Officers at the Miami Beach police station worked for hours on booking Bieber into jail. Both Bieber and Sharief were then taken to the Turner Guilford Knight Correctional Center, where they were fingerprinted and had their mugshots taken.

“Miami nights ridin thru yo city in that hot wheel,” Sharief, who performs under the aegis of Island Def Jams Records, tweeted on his account earlier Thursday morning.

It was the first arrest for Bieber, 19, a native Canadian. Bieber told officers he had been at a recording studio Wednesday evening.

“Miami Beach is a residential community first and foremost as well as a world-class tourist destination. More importantly, our city is committed to the safety of our residents and tourists,” Miami Beach Mayor Philip Levine said in a statement. “Everyone must respect the law and no preferential treatment will be afforded to anyone, regardless of their high-profile or celebrity status.”

A source at SET, a Lincoln Road nightclub, reported Bieber arrived Wednesday night in a yellow Lamborghini with a group of guys and that he sat shirtless with a backwards baseball cap in a VIP room next to the DJ booth. Bieber didn’t say much and ordered Red Bulls and water.

“He looked really pale,” the source said. The group stayed until around 3 a.m., and Bieber left in the Lamborghini with a Miami model whom he “picked up randomly in the club,” the source said. Some photos sent via social media by Sharief included an unidentified woman sitting in the Lamborghini with Bieber.

Bieber was driving a 2013 Lamborghini Gallardo. Sharief was behind the wheel of a 2009 Ferrari 16M. Both cars, worth about $260,000 each, were rented from the Miami exotic car rental company Lou La Vie, confirmed John Temerian, Lou La Vie’s owner.

He said he generally rents the cars for $1,200 to $1,800 a day.

The 2013 Lamborghini Gallardo’s 5.2 liter V-10 engine has 542 to 562 horsepower, depending on how it is equipped, according to Motor Trend Magazine. It can go from zero to 60 miles per hour in 3.4 seconds and reaches a maximum speed of just over 200 miles per hour, according to

The 2009 Ferrari 16M has a V-8 engine, with 503 horsepower. It can from 0 to 60 miles per hour in 3.4 seconds, according to Car and Driver Magazine.

Both cars were expected to be returned to the company’s Miami showroom in the early afternoon.

Instagram photos of Bieber and Sharief were sent via social media earlier from MIA Skate Shop, a South Beach skateboard store, and the two tweeted photos and video from an unidentified local skate park.