Some of the biggest winners in the most expensive election in U.S. history weren’t the politicians, but the private consultants who brought in tens of millions of dollars in fees for advertising, fundraising and other campaign activities.

In the presidential race alone, the two main media firms working for President Obama and Republican challenger Mitt Romney earned profits for handling more than half a billion dollars of campaign advertising, according to disclosures and ad tracking data. Neither company is required to report how much it received in compensation for that work, but their combined cut could easily be $25 million or more at standard industry rates.

Other big earners were the digital strategy companies, telemarketing firms, air charter services, pollsters and consultants who saw a spike in business in a presidential contest that cost at least $2.6 billion. The surge in spending was a financial boon for everyone from the specialized producers that make political commercials to the local television stations that broadcast them.

“Those numbers are eye-popping,” said campaign finance lawyer Kenneth Gross. “This was the first presidential election since Watergate where both candidates rejected federal funds and competed to gather private contributions. It meant there were no holds barred in spending on the general election.”

The expenditures come to light in the midst of a post-election debate about the outsize role of money in 2012, which featured the first presidential contest impacted by court decisions that allowed corporations and unions to spend unlimited funds on elections.

The presidential campaign produced financial winners on both sides of the aisle.

Many of the biggest recipients of money on both sides have close ties to the candidates and do not have to reveal how much they made from the campaign because they are employed by private consultants.

Much of Romney’s operation, for example, appears to revolve around a close-knit group of insiders at American Rambler Productions, which took in more than $160 million through mid-October, records show. The company — named in honor of the American Motors car championed by the candidate’s father — provides compensation to key Romney advisers Eric Fehrnstrom, Beth Myers, Stuart Stevens and Russell Schriefer.

Federal Election Commission records, which do not disclose salaries, show that the Romney campaign paid American Rambler $131 million for broadcast ads, $9.7 million for online costs, $7.7 million for production, $5.1 million for strategy and $2.4 million for communications.

One person familiar with the campaign’s operation, who spoke on condition of anonymity in order to discuss financial arrangements, said the Rambler advisers were compensated under a negotiated contract and that none received commissions based on a percentage of media purchases. The person declined to provide further details.

Another top vendor, Targeted Victory, received $64 million for online advertising and was co-founded by Romney digital director Zac Moffat.

The Romney campaign’s fundraising was handled by a pair of limited-liability corporations, SJZ and Victory Group, both controlled by finance chairman Spencer J. Zwick. The campaign paid the companies more than $22 million over the course of the race; the person familiar with campaign operations said the money included “compensation to over 60 finance consultants.”

Zwick, who began working for Romney as a Brigham Young University college student, also ran fundraising operations for Romney’s abandoned 2008 presidential bid and for Meg Whitman’s failed 2010 run for California governor. Zwick is a partner in a private equity fund he co-founded with Romney’s son Tagg.

Romney’s decision to outsource his fundraising operation to outside companies is unusual for large-scale presidential campaigns; Obama, George W. Bush and other recent candidates have kept that function in house. Wooing and flattering wealthy donors was a key part of Romney’s campaign, which did not have as much success as Obama in attracting small-dollar contributions.

Some Republicans last week raised questions about spending decisions made by the losing Romney campaign and the outside groups that supported it. The GOP campaign spent more than Obama on average salaries and bonuses for senior staff, and structured its advertising budget in such a way that it often paid far more for the same amount of airtime. Romney volunteers also have complained loudly about an expensive poll-monitoring smartphone app that ended up crashing on Election Day.

Romney paid his top advisers more than Obama paid his, including handing out about $500,000 in bonuses for senior staff in August and September, records show. As of Oct. 17, campaign manager Matt Rhoades had received $292,000 in salary and bonuses, compared with $197,000 for Obama campaign manager Jim Messina.

The biggest single recipient was GMMB, the Washington-based media company that handled advertising for the Obama campaign. Through mid-October, the campaign sent more than $306 million to the company led in part by longtime Democratic strategist Jim Margolis, records show.

Margolis said in an interview that the total is misleading since most of the funds are used to pay advertising costs. “The big point is that virtually all of that money goes to television stations to pay for the ads that you see,” he said.

The Washington Post Co. owns six local television stations that reported increased revenue this year from political advertising.

For many years, the standard commission for political media buyers hovered between 10 percent and 15 percent, according to several experts in the field. But as the sheer volume and cost of political advertising has exploded, campaigns have become aggressive in negotiating rates as low as 3 percent, media buyers said.

Margolis declined to say what percentage of gross receipts his firm kept. But when asked whether it was 5 percent, he said: “That’s very high for a race of this magnitude.”

Other top earners on the Obama side were Bully Pulpit Interactive, which handled $77 million for online media and production; AB Data, at $36.4 million; and Fuse, a St. Louis-based ad agency that handled $10.2 million. Senior adviser David Axelrod’s firm, AKPD Message & Media, handled $1.2 million, FEC records show.

Trevor Potter, a former FEC chairman who served as counsel to Republican Sen. John McCain’s 2008 presidential campaign, said money made by media firms “is undoubtedly higher this time.” While it is impossible to know precise profit margins, Potter said he was concerned about “a real bias in spending money on television advertising,” particularly by super PACs and other groups unaffiliated with official campaigns.

“First, it’s easier to write a check to a TV station than set up a real grass-roots campaign,” he said. “Second, there is a built-in bias because the consultants to the campaigns get commissions.”

Overall, the federal elections are estimated to have cost $6 billion, a good portion of which was spent by newly flush conservative groups that failed to win most of the races they contested.

Tad Devine, a Democratic strategist who advised the Al Gore and John Kerry presidential campaigns, said the sheer volume of advertising in 2012 provides ample room for consultant profits.

“These guys spent as much money in Virginia as we used to spend in America,” Devine said. “That is not an exaggeration. It is beyond anything we would have been able to comprehend.”

Staff writer T.W. Farnam contributed to this report.