Transformers star Shia LaBeouf was given a year's probation by a judge in Savannah, Ga., Thursday after pleading guilty to a misdemeanor charge of obstruction stemming from his July 8 arrest for a public outburst.

LaBeouf also pleaded no contest to a charge of disorderly conduct. Prosecutors dropped a charge of public drunkenness.

Police said LaBeouf, who had been in Savannah to film the movie The Peanut Butter Falcon, became aggressive and began shouting vulgarities in a downtown nightlife district after a bystander refused to give him a cigarette. At the time, officers said LaBeouf ran to a nearby hotel in an attempt to avoid arrest.

Video footage of his hostile conversation with the arresting officers surfaced soon after.

"Who you fighting for?" LaBeouf asked antagonistically. "You got a president who don't give a (expletive) about you, and you stuck in a police force that don't give a (expletive) about you. So, you want to arrest — what, white people who give a (expletive), who ask for cigarettes?"

Four days later, he expressed his remorse in a tweet, writing "I am 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 certain that my actions warrant a very sincere apology to the arresting officers, and I am grateful for their restraint. The severity of my behavior is not lost on me."

The actor’s plea deal requires anger-management counseling. He must also complete a drug and alcohol evaluation.

In his July statement, LaBeouf acknowledged, "I have been struggling with addiction publicly for far too long, and I am actively taking steps toward securing my sobriety and hope I can be forgiven for my mistakes."

Contributing: Associated Press