WASHINGTON  Registered lobbyists have donated large amounts of money to Senator John McCain’s presidential campaign, even as he denounces their profession. But Democratic candidates for Congress have also raised prodigious sums from lobbyists, outdoing the Republicans, according to reports filed for the first time under a new ethics law.

Senator Barack Obama, the presumptive Democratic nominee for president, says he does not want money from lobbyists, but a few modest contributions have slipped through. Health care, education, environmental and human rights lobbyists have given to Mr. Obama.

In total, lobbyists and trade groups have reported giving about $10.4 million to presidential and Congressional candidates in the first half of this year.

So far, Mr. McCain, who has locked up the Republican presidential nomination, has received more than $181,600 from lobbyists and trade groups, while Mr. Obama has received just over $6,000. Senator Hillary Rodham Clinton, who ended her bid for the presidency in June, got more than $87,000.