Oft-troubled actor Shia LaBeouf has reached a plea agreement stemming from his arrest in Georgia earlier this year, agreeing to undergo anger management counseling, as well as 30 days of mandatory drug counseling.

The actor was also placed on 12 months’ probation on Thursday, and was ordered to undergo drug and alcohol evaluation and to perform 100 hours of community service, a representative of the Chatham County, Georgia, district attorney’s office told TheWrap.

LaBeouf must also write a letter of apology to the police.

Also Read: Shia LaBeouf Apologizes After Racist Arrest Video Released: 'I Am Deeply Ashamed'

Ultimately LaBeouf pleaded guilty to disorderly conduct and no contest to obstruction of an officer. As part of the agreement, a third charge of public drunkenness was dismissed. LaBeouf must also pay a $1,000 fine for each of the two remaining charges.

LaBeouf was arrested in July in Savannah. Video of his arrest showed the “Transformers” star telling a police officer that he was going to hell because he’s black.

“You’re going to hell, straight to hell, bro,” LaBeouf tells the African American officer in the video.

Also Read: Shia LaBeouf Tells Cop That He's 'Going to Hell' Because He's Black in Arrest Footage (Video)

Asked by another officer why LaBeouf thinks his colleague is going to hell, LaBeouf replied, “Because he’s a black man. … That means a whole lot, bro.”

In a largely incoherent rant, LaBeouf went on to complain of “a black man who arrested me for being white,” denying that he’s racist because he was “asking three black people to have a cigarette.”

LaBeouf later apologized for the incident, tweeting that he was “deeply ashamed of my behavior and make no excuses for it.”

“I don’t know if these statements are too frequent, or not shared often enough, but I am sure my actions warrant a very sincere apology to the arresting officers, and I am grateful for their restraint. The severity of by behavior is not lost on me,” the actor added.