PITTSBURGH—An Allegheny County judge says a former candidate's $52,000 donation to his own campaign has exempted candidates from the city's campaign finance law, which caps donations at $2,000 per person and $4,000 per political action committee.

Candidate and City Councilman Bill Peduto wanted Judge Joseph James to enforce the law, which Peduto drafted in 2009, largely to keep former state auditor general Jack Wagner from using about $350,000 remaining from his state campaigns to run for mayor.

But James says City Controller Michael Lamb triggered a "millionaire's exception" in the law, which exempts candidates from the limits if any candidate loans his own campaign $50,000 or more. James says that exemption holds even though Lamb withdrew from the race earlier this week.

Peduto and Wagner are considered the leading Democrats in the May 21 primary.