A worker makes his way through the gaming floor at Maryland Live!, the state’s largest slots casino. (Katherine Frey — The Washington Post)

Campaign finance reports filed late Tuesday showed a handful of Washington’s biggest media buying firms and Maryland political consultants benefited handsomely from the ballot-box brawl over expanding gambling — the costliest election in state history.

Three ballot-issue committees involved in the fight together raised more than $93 million from gambling companies and others with a stake in Question 7, which will allow a new casino in Prince George’s County and table games at all Maryland slots locations.

The new reports show about $90.5 million of the money collected was spent on the campaign, with nearly $3 million left sitting in the bank accounts of the ballot-issue committees. Much of that will go toward unpaid bills.

MGM Resorts, which is angling to build a casino at National Harbor, was the biggest donor by far to a pro-gambling expansion committee, contributing about $40 million of the $46 million it raised — much of it for television advertising.

A second pro-expansion committee led by former Prince George’s county executive Wayne K. Curry (D) reported having raised $3.1 million and spent $2.7 million, much of it on direct mail and radio advertising.

Penn National Gaming was the sole funder of a ballot committee on the losing side that reported spending roughly $42 million of the $44 million Penn contributed. The company’s properties include a West Virginia casino that stands to lose business when a new venue opens in Prince George’s.

Cash was heaped by the two larger committees on a tight circle of Washington firms that had experience working for casino owners, as well as ties to top Democrats and Republicans.

Billing hours and commissions mounted for former aides and campaign staff to Senate Majority Leader Harry Reid (D-Nev.), who has an especially close relationship with MGM Resorts, his constituent now best positioned to win rights to construct a towering, Las Vegas-style casino on the southern end of Washington’s skyline.

Former aides to Maryland Gov. Martin O’Malley (D), who backed the measure, had much at stake as well. The public affairs firm of O’Malley’s former communications director received payments from both pro-expansion committees; and the brain trust of O’Malley’s 2010 reelection campaign reunited to find the winning message with voters.

Overall, GMMB, the media buying firm on the payroll of the committee backed by MGM, collected the most.

The committee funneled $34.2 million to GMMB to purchase advertising. Company strategists had previously worked on reelection efforts for Reid. The firm’s biggest client this year was President Obama’s campaign.

Media-buying firms take a commission, believed to range between 3 and 15 percent, depending in part on whether the firm also produces the ad.

On the opposition side, the committee backed by Penn National Gaming, sent $25.4 million to Mentzer Media for advertising purchases, and $18.2 million to DCI Group — firms that were also top advertising agents for Republican PACs and the campaign of Republican presidential candidate Mitt Romney.

The Baltimore public affairs firm of O’Malley’s former communications director, Steve Kearney, directly collected nearly $185,000 from the MGM-backed committee and $60,000 from the Curry committee, the reports showed.

Much of that came in the final weeks when the campaign refocused on a message Kearney’s firm helped sell to lawmakers during a special session in August to put the measure on the ballot — that it boiled down to a vote for Maryland, and against sending money to a Penn casino in West Virginia.

In addition to advertising, the MGM-backed campaign sunk another $1.8 million into robo-calls and phone banking efforts, and millions more into field operations, including get-out-the-vote efforts, in the campaign’s final two weeks, the campaign’s report showed.

The Curry-led committee reported $258,650 in payments to Larry S. Gibson, whose political career has included work on the campaigns of Curry and former Baltimore Mayor Kurt Schmoke (D), as well as some national politicians.

I. Nelson Rose, a professor at Whittier College in California who has written extensively about gambling said he sees the costly Maryland ballot fight as part of a third wave of legalizing gambling that has allowed casinos to open in about half of U.S. states.

“Gambling is really spreading everywhere, and most initiatives for new casinos now fail because established players want to limit competition,” Rose said. “The only way to overcome that is for proponents to neutralize criticism, and they need to spend a tremendous amount to do that.”