Two US YouTube stars behind a "bank robber" prank that resulted in an unsuspecting Uber driver being held at gunpoint by police pleaded guilty to misdemeanor charges Wednesday.

In October 2019, California-based twin brothers Alan and Alex Stokes had ordered an Uber while dressed in black with ski masks and duffle bags apparently stuffed with banknotes, while secretly being filmed for their followers.

The driver, who was not aware of the prank, refused to pick them up, but was briefly detained by police at gunpoint after a member of the public witnessed the apparent carjacking and dialed emergency services.

"These crimes could have easily resulted in someone being seriously hurt or killed," said Orange County District Attorney Todd Spitzer in a statement.

"An active bank robbery is not a casual police response and these police officers were literally risking their lives to help people they believed were in danger," he said.

"It is irresponsible and reckless that these two individuals cared more about increasing their number of followers on the internet than the safety of those police officers or the safety of the innocent Uber driver who was ordered out of his car at gunpoint."

Alan and Alex Stokes have more than six million subscribers on YouTube
Alan and Alex Stokes have more than six million subscribers on YouTube AFP / LIONEL BONAVENTURE

The brothers, now 23, pleaded guilty after the court agreed to downgrade a false imprisonment charge from a felony -- which could have led to maximum five-year jail sentences for each -- to a misdemeanor.

They were each sentenced to 160 hours of community service, one year formal probation, and ordered to pay restitution.

Just hours after the Uber incident in Irvine, south of Los Angeles, the brothers performed a similar prank at the University of California campus there -- which they have now been ordered to avoid.

They have amassed giant followings on social media platforms for their candid camera pranks, which often target their own friends and family.

The twins have more than six million subscribers on YouTube, and nearly 30 million followers on TikTok.