Joel Ryan / Invision/AP 1 / 7
Joel Ryan / Invision/AP 1 / 7

LOS ANGELES (AP) -- A judge has dropped a misdemeanor battery charge against Gerard Butler.

RELATED: See which celebs were in trouble with the law in 2009

Superior Court spokeswoman Mary Hearn says the charge was dismissed after a hearing on Tuesday, with the move dependent on the actor completing community service.

Butler could have faced up to six months in jail if convicted.

RELATED: See interviews and clips featuring Gerard Butler

His attorney Blair Berk declined to comment.

City prosecutors say the Scottish-born star of "300" had a run-in with a photographer on Oct. 7 after leaving a premiere party for the film "RocknRolla."

RELATED: See more pics of hunky Gerard Butler

His manager has said Butler was forced to have his driver stop the car after the photographer sped through red lights and almost struck two pedestrians.