LOS ANGELES — A law aimed at combating reckless driving by paparazzi is overly broad and should not be used against the first photographer charged under its provisions, a judge ruled Wednesday.

Superior Court Judge Thomas Rubinson dismissed counts filed under the law against Paul Raef, who was charged in July with being involved in a high-speed pursuit of Justin Bieber.

The judge cited numerous problems with the 2010 law, saying it was aimed at First Amendment newsgathering activities, and lawmakers should have simply increased the penalties for reckless driving rather than targeting celebrity photographers.

Attorneys for Raef argued the law was unconstitutional and was meant merely to protect celebrities while punishing people who gather news.

Prosecutors argued that the law, which seeks to punish those who drive dangerously in pursuit of photos for commercial gain, didn’t merely apply to the media but could apply to people in other professions.

Rubinson cited hypothetical examples in which wedding photographers or even photographers rushing to a portrait shoot with a celebrity could face additional penalties if charged under the new statute.

Raef still faces traditional reckless driving counts.

Prosecutors allege he chased Bieber at more than 80 mph and forced other motorists to avoid collisions while Raef tried to get shots of the teen heartthrob on a Los Angeles freeway in July.