HARRISBURG, Pa. (AP) — Republican Carolyn Carluccio has won the GOP nomination for a seat on the Pennsylvania Supreme Court, which is playing a prominent role in settling disputes over voting rights, abortion rights and gun rights in the presidential battleground.

Carluccio, Montgomery County’s president judge and the party-endorsed candidate, won the two-way race. She defeated Patricia McCullough, a Commonwealth Court judge who lost a primary for a high court seat in 2021, after party allies reported spending nearly $1 million to help her beat McCullough.

On the campaign trail, McCullough repeatedly boasted of being the “only judge in 2020 in the presidential election in the entire country” to order a halt to her state’s election certification.

McCullough was ruling in a Republican-backed post-election legal challenge that sought to tilt victory to Donald Trump in the presidential battleground state. The state’s high court quickly overturned McCullough’s order.

Carluccio will face Democrat Dan McCaffery for the seat in the November general election.

Democrats currently hold a 4-2 majority on the court, which has an open seat following the death last fall of Chief Justice Max Baer, a Democrat.

The court has handled a number of hot-button issues over the past few years.

It is currently examining a challenge to a state law that restricts the use of public funds to help women get an abortion as well as Philadelphia’s challenge to a state law that bars it and other municipalities from restricting the sale and possession of guns.

In recent years, the justices rejected a request to invalidate the state’s death penalty law and upheld the constitutionality of the state’s expansive mail-in voting law. The court also turned away challenges to the 2020 election result from Republicans who wanted to keep former President Donald Trump in power, and ruled on a variety of lawsuits over gray areas in the mail-in voting law.

In one 2020 election case, justices ordered counties to count mail-in ballots that arrived up to three days after polls closed, citing delays in mail service caused by disruptions during the COVID-19 pandemic. The ruling spurred an outcry among Republicans, who challenged the decision in the U.S. Supreme Court.

The nation’s highest court ultimately declined to take the case. The ballots — nearly 10,000 of them — were never counted in any federal race, including for president, because the election was certified while their fate remained in legal limbo. State elections officials said the votes weren’t enough to change the results of a federal election.

In lower court races, Republican Megan Martin won a two-way primary for an open seat on the Commonwealth Court while Democrats Jill Beck and Timika Lane captured the nomination in a three-way race for two open seats on the Superior Court, which hears appeals of civil and criminal cases from county courts.