WASHINGTON (AP) — Money spent on lobbying by corporations, trade associations and special interest groups spiked during the final three months of 2017 as they battled for the biggest breaks possible in the most dramatic tax overhaul in more than 30 years.

The figures for the heavyweights are eye-popping.

The National Association of Realtors tallied $22.2 million between Oct. 1 and Dec. 31, according to newly filed disclosure reports. That's double what the organization spent in the third quarter on lobbying activities. The Business Roundtable spent $17.3 million in the fourth quarter, nearly quadruple the amount over the three previous months, and the U.S. Chamber of Commerce reported spending $16.8 million, a $3.7 million increase.

President Donald Trump swept into the White House promising to "drain the swamp" in Washington, but lobbyists continue to wield considerable influence and they plied their trade with vigor as Congress crafted the $1.5 trillion tax-cut package that Trump signed into law in late December.

The tax overhaul was hustled through Congress in less than two months and mostly written in private. Public Citizen, a nonprofit watchdog group, said in a Jan. 30 report that more than 4,600 lobbyists were engaged specifically on the tax rewrite while several thousand more sought to influence tax policy in addition to other legislative matters. That worked out to 13 lobbyists for every member of Congress.

"Really in terms of galvanizing the entire profession, tax bills do that like nothing else," said Lisa Gilbert, Public Citizen's vice president of legislative affairs.

The National Association of Realtors said the millions of additional dollars in lobbying expenses were spent mostly on targeted advertising in the districts or states of members of the congressional tax-writing committees.

Among the group's successes, according to a lengthy report card it put together, were preserving the exclusion for capital gains on the sale of a home and winning a 20 percent business income deduction for real estate agents and brokers who are set up as "pass-through" companies. That means they pay personal income tax on their business earnings.

The group also took credit for spinning gold from straw. An initial version of the tax bill, for example, proposed capping the mortgage interest deduction at $500,000 — a major change that the organization said would have an "immediate and very negative impact" in high-cost housing markets.

The legislation signed into law by Trump set the cap at a higher level, $750,000, for new loans and exempted most current mortgages from the limit. Not ideal, but better than it could have been.

The Business Roundtable, made up of the CEO's of America's largest companies, promoted what it described as "pro-growth tax reform." The group said the fourth-quarter spending increase reflected increased lobbying activity, paid advertising and the hiring of new staff.

One of the group's lobbyists is its president and CEO, Joshua Bolten, who held a series of high-level jobs during President George W. Bush's administration, including White House chief of staff from 2006 to 2009. In addition to its own lobbyists, the group paid outside organizations nearly half a million dollars to lobby on its behalf during the last three months of 2017.

Along with cutting the corporate tax rate from 35 percent to 21 percent, the tax law grants tens of billions in tax breaks on profits that America's richest multinational companies have kept overseas. Both moves are big victories for big business.

Trump last month highlighted the nearly $250 billion that Apple is repatriating, saying the tech giant would invest $350 billion in the United States in the coming years. But Apple had planned to spend most of that money with its suppliers and manufacturers in the U.S. anyway.

Analysts have predicted that most of those overseas profits will flow into stock buybacks and dividend payments. That's what happened the last time a one-time break on offshore profits was offered more than a decade ago.

Specialized organizations also seized the moment. The Beer Institute spent $1.3 million on lobbying in the final quarter — a $390,000 increase — and cheered the results: two years of federal excise tax relief for America's brewers and beer importers.

Lobbyists didn't always get what they wanted.

Americans Against Double Taxation was formed specifically to prevent the state and local tax deduction from being scrapped. The group, which included the U.S. Conference of Mayors and the National Association of Counties, didn't register to lobby until mid-September and wound up spending around $46,000, a relatively small amount.

But the fight was an uphill one all the way and more money probably wouldn't have mattered. Republican architects of the tax-cut plan needed free up hundreds of millions of dollars for tax cuts and the state and local deduction was a juicy target.

Congress voted to impose $10,000 limit on deductions for state and local taxes. The shift will hit hardest in Democratic-leaning states such as California, Connecticut, Massachusetts, New Jersey and New York.

___

Contact Richard Lardner on Twitter at http://twitter.com/rplardner