Police in Miami Beach, Fla., have charged 19-year-old pop star Justin Bieber with resisting arrest without violence and impaired driving after he was pulled over for drag racing in a yellow Lamborghini early Thursday morning.

The Canadian singer was released from a county jail in the afternoon, not long after he appeared for a bond hearing via video link and his bail was set at US$2,500.

After he was arrested, Bieber told police he had smoked marijuana and consumed alcohol and prescription medication, said police Chief Raymond Martinez at a news conference outside the police station where Bieber was held until he was transferred to the jail.

An officer saw the Lamborghini and a red Ferrari racing in a residential neighbourhood shortly after 4 a.m. after he noticed black sport utility vehicles, which were travelling in a pack as part of the singer's entourage, blocking the street for the race, according to arrest reports.

It is believed the sportscars were travelling at about 100 kilometres-per-hour, almost twice the posted speed limit, during the race, police said.

The Ferrari driver was identified by police as 19-year-old R&B singer Khalil Sharieff, who uses his first name as his stage name. Sharieff was held on a DUI charge and his bail was set at US$1,000.

After alerting other units, the officer who witnessed the race caught up with the Ferrari, while the Lamborghini made a turn and drove off until it was stopped by a second officer.

'Why the f--- are you doing this?'

During that encounter, Bieber refused to co-operate and repeatedly cursed at the officer as he questioned the reason for the traffic stop, police claim.

According to the arrest report, Bieber's breath smelled of alcohol and he had bloodshot eyes, slow deliberate movements and a "stuper" (sic) look on his face.

When the officer asked Bieber to step out of the car, the star asked, "Why the f--- are you doing this?"

Bieber eventually exited and kept putting his hands in his pockets, and he did not comply when he was asked to keep his hands on the Lamborghini for a pat down, police said.

Bieber took his hands off the vehicle and turned to face the officer, saying: "I ain't got no f---ing weapons, why do you have to search me? What the f--- is this about?"

After turning around to face the officer again, the cop grabbed Bieber's right hand and told him he was under arrest. Police claim Bieber resisted by pulling his right arm away, telling the officer: "What the f--- are you doing?"

Police said Bieber failed a field sobriety test at the scene and he began to co-operate when he was taken to a police station for a breath test, drug evaluation and processing.

Bieber denied being drunk: police

On the way there, Bieber told police he was not drunk and he was coming back from recording music at a studio at the time of his arrest.

The celebrity and his entourage were reportedly spotted at nightclubs before he was arrested.

Martinez said Bieber faces a charge of driving with an expired Georgia driver's licence, in addition to resisting arrest without violence and DUI.

Police later released a mugshot that shows the baby-faced singer with a smile on his face. When he appeared before the judge, he wore a standard prison jumpsuit, held his hands in front of him and showed little emotion as he listened to the proceedings.

Bieber's publicist, Melissa Victor, declined to comment.

For a first DUI offence, there is no minimum sentence and a maximum of six months, a fine of $250 to $500, and 50 hours of community service. For anyone under 21, there is an automatic six-month license suspension.

Car photos posted on Instagram

In the hours leading up to the arrest, Bieber posted photos on his Instagram account that were later deleted. One of the photos showed the singer posing with a man in front of the Lamborghini and Ferrari.

Before they were arrested, Sharieff posted an Instagram photo of Bieber sitting in the passenger seat of the Lamborghini as a young woman drove. Bieber posted a photo of the same woman, identified as model Chantel Jeffries, but it was also deleted.

Bieber's Instagram gallery contains several pictures from his stay in Florida after arriving there earlier in the week.

Authorities in the suburban Miami city of Opa-locka are investigating whether the singer was given an unauthorized police escort when he landed Monday at the Opa-locka Executive Airport, the Associated Press reported.

It appears the arrest won't affect Bieber's immigration status in the U.S.

According to federal immigration law, authorities do not revoke a person's visa unless he or she has been convicted of a violent crime or been sentenced to more than one year imprisonment.

Bieber has previous run-ins with law

This is the troubled pop star's latest run-in with the law.

Last week, police searched the Stratford, Ont., singer's swanky pad in the affluent city of Calabasas, Calif., northwest of Los Angeles.

Officers were looking for surveillance video in an investigation into claims that Bieber tossed eggs at his neighbour's home, causing thousands of dollars in damage, inside a gated community.

A member of the singer's entourage was arrested on suspicion of drug possession and later granted bail.

Bieber has not been charged in the vandalism case but the investigation continues.

Previous investigations into Bieber's conduct have not resulted in charges.

In October, prosecutors declined to charge him after a neighbour complained he drove recklessly through the celebrity enclave where he lives.

Prosecutors in November 2012 also declined to charge the singer after a paparazzo accused him of punching and hitting him after leaving a Calabasas movie theatre.

With files from The Associated Press.

@ChrisKitching is on Twitter. For instant breaking news, follow @CP24 on Twitter.