GREENBELT, MD - OCTOBER 19: Ruth Wright, of Mitchellville, MD, encourages a “no” vote on Maryland Question 7, which voters passed 52 percent to 48, following the most costly campaign in state history. It sets the stage for MGM to seek approval to build an $800 million casino at National Harbor in Prince George's County. (Eva Russo/FOR THE WASHINGTON POST)

In a matter of weeks leading up to Election Day, a tight circle of Washington’s biggest media-buying firms with close ties to top Democrats and Republicans cashed in on the fight over whether to build a casino on the edge of the nation’s capital.

In total, gambling interests spent more than $90 million at a rate of over $1 million a day, making the Maryland ballot measure fight one of the costliest in U.S. history. With huge sums of money to spend, and not a lot of time to do it, those for and against the measure turned to a handful of politically connected firms to help them get their message across.

As they waged a campaign for the White House, GMMB, the DCI Group and Mentzer Media Services, three of the largest media buyers for President Obama and for super PACs supporting Mitt Romney, bought air time for Question 7, as it was known.

In the end, voters approved the plan, which will allow not only a casino, most likely at National Harbor, but also table games such as blackjack and roulette at the state’s five previously approved slot-machine sites.

Those firms weren’t the only ones who benefitted financially from the unprecedented spending in Maryland. Former aides and campaign staffers of Senate Majority Leader Harry M. Reid (D-Nev.) performed work for the pro-casino side of the fight, which was funded in large part by MGM Resorts, which is angling to build a Las Vegas-style casino and hotel that could tower over the southern end of Washington’s skyline.

Who won from Maryland gambling expansion

Reid has an especially close relationship with MGM. The senator and the company have swapped employees, while Reid has interceded with Wall Street banks on MGM's behalf and company executives are Reid’s biggest campaign contributors.

Those with ties to Maryland Gov. Martin O'Malley (D) benefited as well. The public affairs firm of O'Malley's former communications director and the brain trust of his 2010 reelection campaign reunited to help push the gambling expansion.

As often happens when gambling rights are at stake, the deluge of money from casino interests spilled far beyond the political class:

Nearly a half-million dollars went to the Washington Redskins for what a company spokesman said was advertising. Campaign filings show a payment of $450,000 went from the pro-casino side to the NFL team the day before it publicly endorsed the casino measure.

On the front lines, armies of door knockers and outspoken community leaders — including the mayor of Forest Heights, the small Prince George’s County community to the north of the likely casino site — were also paid.

And as in other states where church groups have been involved, a coalition that organized rallies and gatherings of African American clergy who urged a “no” vote partnered with a nonprofit group that took in $200,000 from the opposition campaign, public records and the campaign filings show.

“It sort of took on a life of its own,” said Alan Feldman, senior vice president for MGM Resorts International, which spent nearly $41 million to support the ballot measure and has proposed building an $800 million casino and resort at National Harbor.

“What made this so expensive, Feldman added, “was such a well-funded opponent.”

That opponent was Penn National Gaming, operator of Hollywood Casino at Charles Town Races in West Virginia, a favored destination for Washington-area gamblers that could take a substantial hit if another casino opens in Maryland. Over nearly three months, Penn ponied up $42 million for a scathing campaign waged mostly on television.

As Penn and MGM upped the ante, every campaign fundraising record in Maryland shattered. By Election Day, the spending eclipsed the amount that Republicans and Democrats combined spent on every currently held elective office statewide, or the cumulative amount spent seeking control of the governor’s mansion since 1998.

It also put the Maryland measure in the stratosphere of spending alongside California’s costliest-ever ballot fights over taxes and same-sex marriage.

GMMB, Mentzer and the DCI Group placed over $50 million in advertising for and against the ballot measure through Oct. 21. Campaign reports detailing spending since then are not yet public, but campaign sources say much of the more than $30 million spent in the closing weeks also went to the three firms to purchase ads. The firms take a commission believed to range between 3 and 15 percent.

Without knowing the exact commission or the total amount spent on advertising, it is not possible to ascertain precisely how much the companies profited.

Coincidentally, the two sides say, their efforts also broke down largely along party lines, with Democrats working for MGM and Republicans with Penn.

GMMB, which has bought $300 million worth of advertising this year on behalf of President Obama, received nearly $22 million by Oct. 21 to do so for the ballot-issue committee supported by MGM.

Jim Margolis, a top strategist for Obama, said he was the GMMB partner who worked on the gambling measure.

Two other GMMB strategists working on the initiative have ties to Reid: Jon Summers, Reid’s former communications director, and Anson Kaye, who worked on Reid’s 2010 reelection campaign at GMMB.

Margolis also worked on Reid’s 2010 campaign as a media consultant. He said he met MGM chief executive Jim Murren during the 2010 race when Murren appeared in an ad for Reid praising his efforts to save the company’s CityCenter project in Las Vegas, which was having trouble securing credit during the height of the housing crisis.

The pollster that the campaign hired also had long-standing ties to Reid, O’Malley and MGM.

Mark Mellman was paid $364,000 for polling. He, too, worked on Reid’s 2010 campaign, and under O’Malley, the Democratic Governors Association has increased its business to Mellman tenfold.

One of the campaign’s top consultants, Craig Varoga, of the super PAC Patriot Majority, was another common denominator between Reid and O’Malley. Varoga ran an independent expenditure campaign to re-elect Reid in 2010, the same year he was chief strategist for O’Malley’s reelection bid. He also ran Maryland’s first campaign to legalize slot-machine gambling in 2008.

Kearney O’Doherty, the Baltimore firm of Steve Kearney, O’Malley’s former policy and communications director, had its entire office working on the campaign.

Kearney was instrumental in getting the measure to the ballot in the first place, working at an August special session of the legislature for Peterson Cos., developers of National Harbor, as well as MGM.

For its messaging, the committee backed by Penn, which is fairly bipartisan in its campaign contributions, hired Mentzer and DCI group, both prominent Republican consultants.

Mentzer, which was paid $14 million, has placed $100 million worth of advertising this year for American Crossroads, a conservative super PAC, and Restore Our Future, a group backing Romney and others.

The committee’s contract with DCI, which paid $13.5 million, amounted to a repeat of the winning partnership that Penn had used twice in recent Midwestern elections to suppress competition from rival gambling interests and expand its own casino footprint.

Neither a spokeswoman for Penn nor Brian Mentzer returned calls seeking comment; DCI declined to comment.

While nearly all of its spending through Oct. 21 went through DCI and Mentzer, the Penn committee did spread around hundreds of thousands of dollars to bolster grass-roots opposition in Prince George’s County.

It hired Jacqueline Goodall, the part-time mayor of Forest Heights, who said she was otherwise unemployed and looking for work, to be a spokeswoman for the opposition.

Penn also gave $200,000 to Family Faith Future, according to campaign reports. The group has ties to a Baptist congregation in Bowie whose pastor opposes gambling as well as to the Collective Empowerment Group, a coalition of black churches that sponsored anti-gambling rallies and which traces its roots to a banking coalition of black churches in the county.

One of the group’s founders, Melvin Forbes, sought a meeting with Post reporters last month to lay out a case against the gambling measure.

Last week he said he did not know the group had gotten any money from Penn.