RALEIGH, N.C. (AP) — The headliners for North Carolina’s primary on Tuesday include Republicans challenging for an open U.S. Senate seat and candidates hoping to give the GOP a shot at veto-proof majorities in the Legislature.

Getting less billing, but with equal long-term political importance, is a contest that will shape the fall matchups for two seats on the state Supreme Court. At stake this year is whether the court remains majority Democrat or flips to Republican control, with consequences for decisions on redistricting and issues championed by Democratic Gov. Roy Cooper.

It’s a scene playing out across the country this year, as state judicial races become increasingly politicized over issues such as partisan gerrymandering, abortion and gun rights. Voters in 32 states this year will cast ballots on state supreme court seats, which have become a magnet for spending by national interest groups.

Some $97 million was spent on state supreme court elections during the 2019-2020 election cycle, according to the Brennan Center for Justice at New York University’s law school. Conservative groups and super PACs historically have outspent liberal-leaning organizations in state court races.

Spending and campaigning around the judicial races could intensify if the U.S. Supreme Court overturns Roe v. Wade, which a leaked draft opinion indicates justices are prepared to do.

“State courts are going to be front-and-center in the fight over abortion access,” said Doug Keith, an attorney in the Brennan Center’s Democracy Program. “These races … in some states are likely going to take a prominence that they’ve never had before.”

Michigan is among the states where abortion could be a central factor in court races this fall. One Democratic and one Republican justice are up for reelection to a court where Democrats hold a 4-3 majority. The races are technically nonpartisan, even though candidates are nominated by political parties.

Democratic Gov. Gretchen Whitmer is asking the state’s high court to recognize a right to abortion in the state Constitution. She also wants it to declare unconstitutional a 1931 near-total abortion ban that would go into effect if Roe is reversed.

Michigan’s court seats are among the top priorities for the Republican State Leadership Committee, which plans to spend more than $5 million this year on state court races, a record for the group, said spokesman Andrew Romeo.

The group’s other priorities include the races in North Carolina as well as those in Illinois and Ohio — primarily to better position Republicans in the fights over drawing state legislative and congressional boundaries.

“People used to think redistricting was a 10-year fight,” Romeo said. “Now it’s going to be a battle every election cycle because there’s critical supreme court races every election cycle that have the ability to impact redistricting.”

Groups on the left, including the National Democratic Redistricting Committee, also are getting involved, although the group would not say how much it will invest in the races.

“We are already seeing Republicans attempt to rig the judicial system against fairness, particularly in states like Ohio, North Carolina and Michigan, and we will fight back against these attempts to threaten the independence of state courts,” Kelly Burton, the committee’s president, said in a statement.

The parties have fought bitterly over redistricting in North Carolina since the previous set of maps was drawn following the 2010 Census.

Voters on Tuesday will choose the Republican nominee for one of two seats on the ballot this fall, a race that is among several drawing outside money fueled by redistricting disputes. No primary is needed for the second seat because only one Democratic and one Republican candidate are running.

The court earlier this year struck down maps for Congress and the state legislature that were drawn by the Republican-controlled General Assembly. In its 4-3 ruling, the North Carolina Supreme Court called the districts illegal partisan gerrymanders. Lawmakers will get a chance next year to redraw the congressional map because the one used for this year’s election was approved on an interim basis, giving Republicans added motivation to try to unseat the two Democratic justices this year.

Gerrymandering isn’t the only reason the court races this fall will be crucial for North Carolina Democrats, said David McLennan, a political science professor at Meredith College in Raleigh. Losing those seats also would be damaging to Cooper, especially if Republicans win veto-proof majorities in the legislature, he said.

“It just puts more pressure upon Democrats to try to retain those (court) seats,” he said.

Earlier this year, the Republican state committee targeted Democratic Justice Sam Ervin IV — whose grandfather presided over the Watergate hearings in the U.S. Senate — with an ad calling on him to bow out of the redistricting case because a ruling could have affected the rules for elections this year, when he is on the ballot. Ervin refused to recuse himself.

Court of Appeals Judge April Wood, one of three candidates seeking the GOP nomination to unseat Ervin, said on her website that she’s running in part to ensure “a constitutional, conservative majority” on the court. A campaign video by one of her rivals, Administrative Office of the Courts General Counsel Trey Allen, touts him as “the conservative leader we need.” Greensboro attorney Victoria Prince also is running in Tuesday’s primary.