A marquee Senate race pitting Democrat Kay Hagan against whichever Republican emerges from next Tuesday’s crowded primary is getting all the attention in North Carolina, boosting voter interest and turnout. At the same time, significant sums of money, totaling $1 million at last count, are flowing into the state to affect the outcome of a judicial primary, “usually a pretty sleepy enterprise,” says Bert Brandenburg, executive director of Justice at Stake, a nonpartisan group that monitors judicial elections.

Money buys airtime, and across North Carolina on 10 stations, incumbent state Supreme Court Justice Robin Hudson, a Democrat, is labeled in a television ad “not tough on child molesters.” That’s based on her dissent in a narrowly decided 4-3 ruling that said satellite monitoring of some sex offenders was not a new punishment, which would be unconstitutional, even though it did not exist at the time of their offense.

“This is a way of trying to bully the bench,” says Brandenburg. “Nasty campaign ads send a message to judges that as they make rulings on controversial cases, they may get ads against them down the line, and that’s not what they should be thinking about. They’re supposed to focus on facts and the law.”

Now North Carolina is ground zero in the partisan battles, but just a few years ago, the state was working hard to insulate judges from the onslaught of cash that many see as distorting democracy. It was the first in the nation to try public financing in judicial races, saying candidates shouldn’t have to spend all their time raising money, especially Supreme Court judges.

Over a decade ago, a fund was created using attorney fees to provide minimal campaign financing through state grants to qualifying candidates. The program was enormously popular; 80 percent of judges who ran used it, and it helped diversify the bench with more women and African-Americans. But there was always ideological opposition from the right on free speech grounds, and when Republican Gov. Pat McCrory took office in January 2013, one of the first things his budget director did was zero out public financing for judges.

The dam had broken anyway with the U.S. Supreme Court’s Citizens United 2010 decision, and judicial races have become a free-for-all just like every other political contest. Judges in North Carolina run without party identification; the races are nonpartisan, but everyone knows where their party allegiance lies. Two years ago, in a contested judicial race, “Ninety percent of outside money came from the conservative side,” says Chris Kromm, executive director of the Institute for Southern Studies. “They were way more on top of this game.”

In an interview a week before the May 6 primary, Kromm said he didn’t think Democrat Hudson had received any money from outside groups so far. “It’s possible it will come in the last few days, but so far I haven’t seen it,” he said. Justice at Stake found Hudson spent $86,000 to mount an ad rebutting the claims that she sides with predators and citing endorsements of her character and record from seven former state Supreme Court justices. The money is characterized by the nonpartisan group as “a drop in the bucket” compared to what is being spent against her.

Much of the money flowing in from the conservative side, from Koch Industries and the Washington, D.C.-based Republican State Leadership Committee, is funneled through a local group, Justice for All North Carolina. “State courts are the engine of day-in and day-out justice,” where 98 percent of cases are decided, says Brandenburg. “It’s like the fishing hole that gets discovered. A whole generation of judges is in a system they didn’t sign up for.”

In the supposedly nonpartisan primary, Hudson faces challenges from two Republicans, one from the mainstream of the party, Superior Court Judge Eric Levinson, the other, Jeanette Doran, a late entry into the race. Doran has no judicial experience and is the former executive director of the North Carolina Institute for Constitutional Law. The nonprofit group is backed by Art Pope, a wealthy businessman who finances conservative candidates and causes, and who McCrory named budget director after taking office 16 months ago.

Republicans have a 4-3 advantage on the state Supreme Court, and “they see an opportunity to strengthen their hand and increase their majority,” says Kromm, who explains that incumbent judges usually have a real advantage. Voters don’t pay much attention to judicial races, and no one thought Hudson was vulnerable. But between the flood of money and an effective negative ad, Kromm says the likely outcome in the nonpartisan primary is that the two conservatives emerge to run against each other in November, the Democrat is sidelined, and the Republican advantage on the court is 5-2.

Since 2008, when North Carolina voted for Barack Obama, the state has taken a real right turn. Under McCrory and a majority Republican legislature, a slew of laws have been passed, others have been repealed, and challenges to the constitutionality of an energized conservative agenda will come before the state Supreme Court. So a strong majority on the court is a real political prize.

The court will rule on redistricting lawsuits and on the Racial Justice Act, landmark legislation passed in 2009 that the legislature struck down last year. Public vouchers for private schools, teacher tenure, and what Democrats call “the monster anti-voting bill” are all making their way to the court. A win in Tuesday’s primary could strengthen the foundation for many more conservative victories, lessening the likelihood of an independent judiciary to stand up to the politicians.