SACRAMENTO—A Sacramento County judge late Friday dismissed charges against current and former corporate officers of the online classifieds site Backpage.com, finding the broad immunity of the federal Communications Decency Act shields the men from prosecution in a sex-trafficking case.

Superior Court Judge Michael Bowman said the California attorney general’s office failed to prove CEO Carl Ferrer and former shareholders Michael Lacey and James Larkin developed or encouraged the development of any of the escort ads that were at the heart of the case.