Pop star Justin Bieber has appeared before a Miami court accused of driving under the influence of alcohol, marijuana and prescription drugs.
They said he did not co-operate when pulled over and also charged him with resisting arrest without violence and having an expired driving licence.
The 19-year-old singer was granted bail set at $2,500 (£1,500).
He had appeared before the judge via video-link from a Miami prison. He later left the jail escorted by officials and his personal entourage, before climbing on to the roof of a sports utility vehicle to wave to fans.
He has had several run-ins with police over the past year.
In the latest incident, police said the singer had been racing a yellow Lamborghini against another sports car in the early hours of Thursday.
The Miami Herald reported that members of the musician's entourage had apparently used their cars to block traffic on Pine Tree Drive at 26th Street, effectively creating a drag strip.
Miami-Dade Police said the star didn't co-operate with officers at first, questioning why he had been stopped. He also had an invalid Georgia driver's licence, they alleged.
The other driver was later named as an R&B singer known as Khalil. He was also set bail by the court.
"During the investigation Mr Bieber made statements that he had consumed some alcohol, that he had been smoking marijuana and consumed some prescription medication," said Miami Beach police chief Raymond Martinez.
"They were starting from a stop position and they were accelerating to a high rate of speed, going almost double the speed limit... in that area."
The arrest report said the singer "had slow deliberate movements" and a look of "stupor" when the officer told him to step out of the Lamborghini.
The two men were first taken to Miami Beach police station and later transferred to a Miami-Dade County jail before their court appearance.
The street where police say Mr Bieber was racing is a residential area in mid-Miami Beach.
Small apartment buildings are along one side of the street and on the other side are a high school, a youth centre, a golf course and a fire station.
The arrest came a week after Mr Bieber's home in Los Angeles was searched by police following allegations he had thrown eggs at his neighbour's house.
He was accused of causing significant damage to the property. One member of his entourage was arrested for alleged drug possession following the search.
Last year, the singer was asked to remove graffiti he had left on the wall of a hotel in Australia. That came a month after he was charged in Brazil over a similar offence.
In 2012 he faced accusations of reckless driving, although prosecutors declined to press charges.
Justin Bieber lives in a gated community in Calabasas, about 30 miles north-west of central Los Angeles.