In 2004, West Virginia coal baron Don Blankenship put $3 million into a state Supreme Court election, funding an outside-money group that helped put his preferred candidate on the bench. That judge later voted to overturn a $50 million judgment against Blankenship's company, Massey Energy.

Twelve years and two elections reform bills later, Blankenship is headed to prison for violating mine safety rules, but outside money — some connected to a close ally of Blankenship's — won again, this time replacing the justice Blankenship had backed with the candidate currently favored by the business community.

Outside groups, which are allowed to raise and spend unlimited amounts of money from individuals, corporations and unions but may not coordinate with candidates, dished out more than $3.5 million in a West Virginia Supreme Court race featuring five candidates. Eighty-six percent of that money, over $3 million, benefited Beth Walker, who coasted to victory with almost 40 percent of the vote, 16 percentage points more than her nearest competitor.

After Blankenship's conspicuous purchase of the state supreme court seat in 2004, and a 2010 ruling by the U.S. Supreme Court that the justice Blankenship helped elect, Brent Benjamin, had erred by not recusing himself from the Massey Energy decision, the West Virginia legislature established a judicial public financing program. Candidates who raise between $35,000 and $50,000 in small donations from at least 500 individuals qualify for up to $500,000 in campaign funds from the state. Two candidates, incumbent Benjamin and attorney Bill Wooten, used the program, but their funds were no match for the outside money spent in the race.

The legislature also made judicial elections nonpartisan last year, hoping to depoliticize them, to no avail.

This year's result, a pro-big business Republican smashing the field with millions in outside support, shows that the state has more work to do to rein in big money in judicial elections.

"When the influence of wealthy individuals and corporations enters our courtrooms, West Virginians pay the price with a state government that fails to take into account the needs of all of our citizens," said Natalie Thompson of the good-government coalition West Virginia Citizens for Clean Elections.

Because some of the outside entities that spent big on the race are secret-money groups that are not required to disclose their donors, it's unclear which special interests or individuals directly funded the effort to seat Walker. Unlike after 2004, when Blankenship's $3 million donation to an outside group called And for the Sake of the Kids was made public because the group was a 527 political organization required to disclose its donors, it may be difficult to link Walker's future votes to the interests that helped elect her.

But a group that spent over $104,000 on mailers supporting Walker called West Virginians for Fair Courts received $25,000 from another group, West Virginia Citizens Against Law Abuse, which has criticized Benjamin and supported Walker. Until 2015, the latter group was run by Greg Thomas, the former Blankenship aide who ran And for the Sake of the Kids in 2004. Citizens Against Law Abuse is now led by Roman Stauffer, who ran Walker's 2008 Supreme Court campaign.

West Virginians for Fair Courts was established just last month by Thomas, according to Internal Revenue Service records.

Walker is no stranger to Blankenship and the coal industry. According to Mother Jones, Walker worked for the corporate law firm Bowles Rice, which often represents coal companies. Her husband, Mike Walker, is a former executive of Walker Machinery, which contracts with coal companies and donated $25,000 to And for the Sake of the Kids in 2004.

The bulk of the outside money this year, however, came from the Republican State Leadership Committee (RSLC), a Washington, D.C.-based super PAC that helps elect Republicans to state legislative office and that in recent years has poured millions into state court races, often through its Judicial Fairness Initiative.

The RSLC is funded almost entirely by corporations, including West Virginia Coal Association members Alliance Coal of Tulsa, Oklahoma, which gave $70,000 between 2010 and 2012; Alpha Natural Resources of Abingdon, Virginia, which gave $54,000 since 2012, including $10,000 in June of last year; and Consol Energy of Canonsburg, Pennsylvania, which has given $315,000 since 2010.

According to state campaign finance records, the RLSC spent more than $2.6 million either supporting Walker or attacking her opponents. The RSLC spent $3.4 million on state supreme court races in four states and a local court contest in another during the 2013-14 election cycle, and it has already matched that amount this cycle.

The West Virginia Chamber of Commerce spent almost $220,000 praising Walker, and Moving West Virginia Forward Business and Industry Council PAC spent nearly $55,000 on radio ads in her favor. Opposing Walker was Just Courts for West Virginia PAC, an attorneys' group, which spent close to $500,000. Regenerate West Virginia, a progressive political action committee, spent a small amount in favor of candidate Darrell McGraw.

The candidates spent far less than outside groups, at just over $1.6 million.

Thompson and West Virginia Citizens for Clean Elections support an amendment to a bill introduced last year requiring any entity that spends over $1,000 in a calendar year to report its donors.

"Moving forward, the best thing to do is increase transparency in disclosure," Thompson told Facing South. "And we still believe that if we establish permanent funding for our public financing system, that more and more people who are disadvantaged and don't have big money bankrolling their campaigns would be less inhibited and potentially more qualified to run for the open seats not only in our courts but also for other elected positions."