Outside political groups set new spending records in North Carolina's 2016 state elections.

A Facing South investigation finds that these groups — independent committees that can spend unlimited amounts on elections but may not coordinate with political candidates — flooded the 2016 state-level elections with nearly $33.1 million. That's more than double the previous record of $14.5 million set in 2012, the most recent election when the governor's mansion was on the line.

The U.S. Supreme Court's 2010 Citizens United ruling, along with a lower federal court decision in a related case, lifted restrictions on corporate spending in elections. Since then, outside spending on political races has grown dramatically, both nationally and in the states.

Super PACs, 501(c)(4) "social welfare" nonprofits and trade associations, often funded by corporations or national advocacy groups, flocked to North Carolina last year as then-Gov. Pat McCrory (R) was seen as the nation's most vulnerable Republican governor.

Facing South logged 1,152 outside political expenditures in 165 state-level races. This interactive graphic details the findings:

Some takeaways from the data:

* The partisan spending gap is shrinking.

In 2010, outside groups spent over nine times more to help elect Republicans than Democrats in North Carolina, according to the N.C. Free Enterprise Foundation. But Facing South finds the partisan spending gap has narrowed since then as liberals organized and funded their own independent spending networks. In 2014, 53.4 percent of all outside spending on state races helped GOP candidates; in 2016 that fell to just over 51 percent.

* A GOP group was the leading outside spender.

Dishing out the most outside money on North Carolina state elections last year was the Washington, D.C.-based Republican Governors Association, a super PAC funded largely by corporations including Koch Industries, Blue Cross Blue Shield and North Carolina-based companies Reynolds American tobacco and Duke Energy. It spent over $6.3 million opposing now-Gov. Roy Cooper, a Democrat.

Democrats had their own answer to the RGA: a new committee called A Better N.C., which spent $4.3 million on ads opposing McCrory. It got $2 million from Make N.C. First, a North Carolina-based "social welfare" nonprofit that's not required to disclose its donors. Also funding A Better N.C. were national committees including the Democratic Governors Association and its affiliated nonprofit America Works USA ($1.7 million), and the pro-LGBT Human Rights Campaign ($100,000).

* The governor's race was the top outside-money magnet.

North Carolina's down-to-the-wire gubernatorial race drew the most outside money of all state races by far, with independent groups spending $16.4 million on the contest — more than the total outside spending in the state in 2012. Of that amount, $8.1 million backed McCrory while $7.2 million aided Cooper.

While the Republican Governors Association and A Better N.C. were the top outside spenders on the governor's race, other groups also spent significant amounts. On the Democratic side, a super PAC connected to the League of Conservation Voters and its North Carolina branch spent more than $1.6 million in support of Cooper, while Planned Parenthood chipped in nearly $1 million.

On the Republican side, Freedom Partners Action Fund, a super PAC that's part of the conservative political network run by billionaire industrialists Charles and David Koch, spent nearly $540,000 on ads opposing Cooper, while the anti-LGBT group N.C. Values Coalition spent over $530,000 on ads criticizing Cooper for his stance against the state's discriminatory House Bill 2 (HB2), the so-called "bathroom bill."

* State court races drew big money.

The race for a North Carolina Supreme Court seat also saw record spending in a state that's had two successive high court contests with steep price tags.

Outside groups spent over $5 million on the 2016 contest between incumbent Republican Bob Edmunds and Democratic challenger Mike Morgan in a race to determine the high court's ideological balance. With Morgan's win, the court now has a 4-3 liberal majority.

Outside groups spent $2.6 million supporting Edmunds and $2.4 million backing Morgan. The liberal super PAC N.C. Families First spent over $1.7 million opposing Edmunds. That PAC received funding from the Democratic Governors Association as well as three shadowy nonprofits — N.C. Citizens for Protecting Our Schools, Make N.C. First and Real Facts N.C. — that aren't required to disclose their donors.

Besides the blockbuster Supreme Court race, N.C. Court of Appeals contests also drew significant amounts of outside money. Two out of the five races for seats on the state's second-highest court drew more than $100,000 in outside spending, far more than previous races tracked by Facing South. All were won by Republicans.

* HB2 appears to have had an impact.

As Facing South has reported, North Carolina's "bathroom bill" requiring transgender people to use public restrooms that match the gender on their birth certificate and restricting local anti-discrimination protections likely affected the outcome of several races. To date, boycotts responding to HB2 have cost the state at least $560 million in lost revenue.

In the gubernatorial race, the pro-LGBT Human Rights Campaign teamed up with the Equality North Carolina Action Fund in an initiative called TurnOUT N.C., which mobilized voters to cast ballots for candidates who support LGBT rights including Cooper, who took a strong stand against HB2. The Human Rights Campaign spent over $1 million on ads and phone calls supporting Cooper and opposing McCrory.

The conservative N.C. Values Coalition spent $530,000 against Cooper, far more than it has spent in past elections. Most of that money came from a mysterious Chapel Hill-based nonprofit called Ad Valorem formed less than two weeks before the election. Also contributing to the coalition was the national Family Research Council, which the Southern Poverty Law Center has classified as an anti-LGBT hate group.

Successful Democratic Attorney General candidate Josh Stein opposed HB2 and benefited from the TurnOUT N.C. campaign. Meanwhile, N.C. Families First sent out hundreds of thousands of dollars' worth of mailers tying GOP state House members to HB2; two of those representatives lost their seats.

* What was Art Pope's role?

Art Pope, a longtime leading conservative benefactor in North Carolina politics, continued to fund outside groups that were active in the state's 2016 elections.

In 2015, Pope's family foundation gave at least $100,000 to Charles and David Koch's Americans for Prosperity Foundation, a 501(c)(3) nonprofit that has an affiliated "social welfare" arm, Americans for Prosperity, which spends millions of dollars around the country backing conservative candidates and mobilizing voters. The discount retail store magnate is a longtime ally of the Kochs, having helped found Americans for Prosperity.

While 2016 contribution data is not yet available from the IRS, Pope's foundation has consistently given to the Americans for Prosperity Foundation, and Pope attended a 2016 Koch donor seminar, indicating he still contributes a minimum of $100,000 per year to the Koch political network. Americans for Prosperity spent nearly $370,000 opposing Cooper last year. Along with Freedom Partners, to which Pope's retail business Variety Stores gave $100,000 in 2015, these Koch-funded groups spent about $950,000 on the North Carolina governor's race.

Also in 2015, after Pope left his post as state budget director, Variety Stores gave $50,000 to the Republican Governors Association, which supported McCrory, and another $50,000 to Real Jobs N.C., an outside political group he founded. Though Real Jobs didn't report any direct political expenditures in 2016, it did raise money to aid McCrory.

* New outside spending groups are cropping up.

By October 2016, several new outside spending groups had popped up in North Carolina, some connected to well-established advocacy organizations.

The Democratic Attorneys General Association funded a Raleigh-based committee called Protect North Carolina's Future, which was created in 2014 but didn't make political expenditures that year. The committee spent over $2.6 million against former Republican state Sen. Buck Newton in the attorney general's race. Carolinians for Freedom, which the Republican Attorneys General Association formed in 2016, spent almost $1.5 million against Newton's Democratic opponent, former state Sen. Josh Stein, who won.

A group called Truth and Prosperity that was formed in 2015 and funded by the national Republican State Leadership Committee (RSLC) and North Carolina business executives spent $1.3 million to re-elect Republican Dan Forest as lieutenant governor. Fair Judges — a group also funded by the RSLC as well as by North Carolina corporations including Medical Mutual insurance and Reynolds American tobacco — spent nearly $1.2 million on the Supreme Court race.

The League of Conservation Voters-connected Conservation Votes PAC, the Planned Parenthood Action PAC N.C. and the N.C. Values Coalition PAC were also formed in 2016 and directed much of the outside political money coming from their parent organizations.

* What to expect in 2018.

The next governor's race isn't until 2020, and typically off-year elections don't draw as much outside money. If previous patterns hold, 2018 will see less than the $33 million in total outside spending from 2016.

However, with anti-Trump fervor likely to continue and affect Republicans more generally, next year's elections have the potential to be a liberal version of 2010, when an uprising of Tea Party conservatives and a big increase in outside spending by conservative groups led to electoral victory for like-minded lawmakers across the country.