Justin Bieber Justin Bieber

Justin Bieber has struck a plea deal to avoid any jail time for his arrest in Miami earlier this year, The Associated Press reports.

Two sources involved with the case said Bieber will plead guilty to misdemeanor careless driving and resisting arrest without violence, as opposed to driving under the influence. Bieber will also take an anger management course and make a $50,000 charitable donation in addition to all court-ordered fines.

Justin Bieber's ridiculous hats

Bieber was pulled over and arrested on Jan. 23 in Miami Beach for driving under the influence and illegally street race in a residential neighborhood with his friend Khalil Amir Sharieff. However, neither Bieber nor Sharieff were charged with drag racing and there was little to no evidence they were even speeding at the time of their arrests.

Though an arresting officer initially claimed Bieber reeked of alcohol when he was pulled over, Bieber's blood alcohol content at the time was below the 0.02 limit for underage drivers. However he did have marijuana and Xanax in his system.

Last month, Bieber plead no contest to charges of vandalism for egging his neighbor's house. He agreed to pay a fine, attend anger management classes and was put on two years' probation.

Watch this Tonight — Legends