Stealthy nonprofits and other outside interest groups spent more than $11.7 million in 10 high-profile state supreme court elections in 2012 and 2013 with nearly 40 percent spent by groups whose money came mostly from across state lines.

Out-of-state influence likely helped decide races in North Carolina, Iowa and Mississippi according to an investigation by The Center for Public Integrity.

Center researchers used state campaign finance reports, federal tax records and Federal Communications Commission filings to track the spending. The bulk of the outside spending came from Washington, D.C.-based organizations.

The states were chosen because of the visibility of the races and the significant level of non-candidate spending observed in the contests.

In the 10 state races analyzed by the Center, national political groups were active directly or indirectly in seven. Seventy-five percent of the outside money could be traced to the long-running battle between trial lawyers and business interests.

Trial lawyers helped carry the day in Florida, Louisiana and Oklahoma, while business groups, especially, the U.S. Chamber of Commerce, got their way in North Carolina, Michigan, Ohio and Mississippi.

State supreme court races were awash in ads, mailers and robo-calls paid for with money from across state lines. More than one-third of the $11.7 million spent in 10 high-profile elections originated out-of-state, with the bulk of that money coming from Washington, D.C.-based organizations. Follow the money flow from the blue buttons to the destination elections.

No. 1 Florida: $3.3 million

Two conservative groups and the Florida Republican Party attempted to oust three justices in the Sunshine State in 2012.

The groups - Tallahassee-based Restore Justice and northern Virginia-based Americans for Prosperity - spent a pittance compared with the influx of cash from the state's trial lawyers and a coalition of unions, who spent more than $3.2 million. The money was funneled through a group called Defend Justice from Politics.

The total was tops among outside groups that spent money on state supreme court elections last year.

America Votes, a D.C.-based, union-backed group, contributed $300,000 to Defend Justice, making it the single biggest donor. Nine Florida law firms each gave $100,000 or more.

Voters retained the three justices - R. Fred Lewis, Barbara Pariente and Peggy Quince.

Restore Justice, which hoped to oust the justices, raised $75,000. An official for Americans for Prosperity, the organization tied to billionaire industrialists Charles and David Koch,  estimates the group spent less than $100,000.

No. 2 North Carolina: $2.6 million

Independent groups accounted for at least $2.59 million in spending, a total that overwhelmed the public finance system, rendering it largely irrelevant. More than half the spending came from groups outside the state.

Justice Paul Newby eked out a win over challenger Sam Ervin IV.

The top spender was the North Carolina Judicial Coalition at $1.94 million. Its top patron was Justice for All NC which received 68 percent of its money, or $1.2 million, from the Washington, D.C.-based Republican State Leadership Committee. RSLC's top donor was the U.S. Chamber of Commerce's Institute for Legal Reform at $3.5 million.

The Institute, a major foil of trial lawyers, lobbies for legislation that would mandate lower damage awards in civil trials.

Also active was the Washington, D.C.-based nonprofit Judicial Crisis Network which gave $75,000 to pay for radio ads supporting Newby. The group doesn't disclose its donors.

 "The average voter doesn't need to trace every dollar to figure out whether to vote for a candidate," says Judicial Crisis Network's chief counsel, Carrie Severino.

Who paid for "Banjo"? In one of the most widely-shown political advertisements in North Carolina's 2012 supreme court election, a banjo player croons about Justice Paul Newby's tough stance on crime. Despite the folksy tone, the true source the ad's funding can be traced to the Washington, D.C.-based Republican State Leadership Committee. The RSLC donated $1.2 million to North Carolina-based, Justice for All NC, which in turn gave $1.5 million to the North Carolina Judicial Coalition, the group behind "Banjo."

No. 3 Michigan: $1.6 million

In Michigan, the Judicial Crisis Network spent more than $1 million on a last-minute attack ad against Democratic supreme court candidate Bridget Mary McCormack, who won anyway.

The group's spending was reported by a watchdog group, Michigan Campaign Finance Network, which collected filings from local TV stations to calculate the group's spending.

Regulatory filings show that the group has several ties to well-connected conservative political operatives. It shares office space in Washington, D.C., with Grover Norquist's anti-tax group, Americans for Tax Reform.

Gary Marx, former executive director of the Judicial Crisis Network's, is executive director of the Faith and Freedom Coalition, evangelical powerbroker Ralph Reed's advocacy organization.

Treasurer Neil Corkery holds the same title for the National Organization of Marriage, the largest anti-gay marriage group in the country. The group spent at least $148,000 in Iowa's state supreme court race last year.

No. 4 Ohio: $1.2 million

Partnership for Ohio's Future, an affiliate of the Ohio Chamber of Commerce, spent more than $1.1 million in a losing effort to help Republican Justice Robert Cupp win re-election.

The organization didn't disclose its donors, but in past years the U.S. Chamber has been a major contributor, according to the watchdog group Ohio Public Action.

Tax records show the local chamber gave the group $500,000 in 2012, and tobacco giant Reynolds American Inc. reported giving $100,000 to the group last year.

No. 5 Iowa: $833,000

In Iowa, 57 percent of the money spent in a retention election for Justice David Wiggins came from groups backed primarily by out-of-state donors.

Conservative groups, including Colorado-based Focus on the Family, the D.C.-based National Organization for Marriage and the Pennsylvania-based Patriot Voices run by former presidential candidate Rick Santorum, spent $225,000 trying to toss Wiggins from the bench.

None of these groups disclose their donors.

In 2010, conservatives successfully unseated three of Wiggins' former colleagues after the high court voted unanimously in favor of gay marriage.

Wiggins won, thanks in large part to $115,000 spent by another non-disclosing nonprofit, the gay-rights group Human Rights Campaign.

No. 6 Wisconsin: $819,000

Earlier this year in Wisconsin, pro-business groups spent nearly $700,000 in the state supreme court race, helping incumbent Justice Patience Roggensack cruise to victory over challenger Ed Fallone.

State supreme court races were expensive affairs in recent years in Wisconsin, but this year's contest was more subdued as liberal groups didn't spend much to back Fallone.

The state arm of Club for Growth, an anti-tax group, spent at least $287,000 on TV ads supporting Roggensack's bid, according to FCC records. The group is not required to disclose its donors.

The National Association of Realtors, based in Chicago, spent at least $206,000 supporting Roggensack via the organization's state chapter.

No. 7 Mississippi: $638,000

Improve Mississippi, funded heavily by a state physicians' political action committee, state business groups and the D.C.-based Americans for Tort Reform, reported spending $450,000 in support of Josiah Coleman in his race against Flip Phillips in a race that is technically non-partisan.

Coleman's other backer, the northern Virginia-based Law Enforcement Alliance of America, did not disclose its donors or spending.

Coleman won with 58 percent of the vote, even though Phillips' campaign raised more money.

The LEAA spent at least $188,000, according to records filed by Memphis television stations with the Federal Communications Commission. The total does not reflect amounts spent in smaller markets.

Several observers in Mississippi, including former supreme court justices, believe that the U.S. Chamber of Commerce is supplying the money behind the LEAA's attack ads.

Neither the Chamber nor the LEAA responded to requests for comment.

No. 8 Louisiana: $561,000

Trial lawyers prevailed in Louisiana, where the Republican candidate they supported won the seat.

No. 9 Oklahoma: $160,000

Spending by trial lawyers in Oklahoma helped retain four justices.

No. 10 Montana: $42,000

In Montana, where a little money goes a long way, a mysterious outside group called the Montana Growth Network helped sway the course of that judicial race.

The Center for Public Integrity is a non-profit, independent investigative news outlet. For more of its stories on this topic go to publicintegrity.org.