Pennsylvania Republicans have nominated a veteran appeals court judge to be their party’s nominee for Supreme Court justice, setting the stage for a high-stakes fight for an open seat on the state’s highest court.

Commonwealth Court Judge Kevin Brobson of Dauphin County defeated two GOP rivals, the Associated Press projected Wednesday. He will face Superior Court Judge Maria McLaughlin, a Philadelphia Democrat who ran unopposed for her party’s nomination, in November’s general election.

They’ll vie for a seat being vacated by Chief Justice Thomas Saylor, a Republican who reaches the mandatory retirement age this year. Democrats hold a 5-2 majority on the court, so the balance of power isn’t in play.

The Supreme Court primary was the highest-profile judicial race on the ballot Tuesday. The court in the past few years has issued decisions on contentious issues like partisan gerrymandering, the rules for the 2020 election, and Gov. Tom Wolf’s emergency powers.

» READ MORE: Pennsylvania elects most judges. Here’s how the process works.

Brobson, who was first elected in 2009 and had the support of the state Republican Party, defeated appeals court judge Patricia A. McCullough and Philadelphia trial judge Paula Patrick.

McLaughlin was elected in 2017 to Superior Court, one of two statewide appellate courts, and was previously a trial judge and longtime prosecutor in the Philadelphia District Attorney’s Office.

Voters on Tuesday also cast ballots in primary elections for Commonwealth Court and Superior Court, the state’s two intermediate appellate courts. The courts hear thousands of appeals each year, and only a select few reach the state Supreme Court.

There is one open seat on the bench for Superior Court, which has 15 judges. Republican Megan Sullivan, a longtime prosecutor in the Chester County District Attorney’s Office and former deputy state attorney general, won an uncontested primary for Superior Court.

Sullivan will run against Philadelphia trial judge Timika Lane, who the AP projected won the Democratic nomination for Superior Court against civil litigator Jill Beck and attorney Bryan Neft, both of Allegheny County.

There are two seats for the Commonwealth Court, which has nine judges.

Republicans Drew Crompton and Stacy Marie Wallace ran unopposed in the GOP primary. The four-candidate Democratic primary remained undecided Wednesday afternoon. Lori Dumas and David Purgeon had the most votes with 76% of the projected total votes counted, according to the AP. Sierra Street and Amanda Green Hawkins trailed.

In Philadelphia, 16 candidates ran in the Democratic primary for Common Pleas Court, which handles criminal and civil cases. There are eight available seats on the bench, and no Republicans were on the ballot in the heavily Democratic city. That means the primary election effectively decides the outcome.

As of Wednesday afternoon, the top vote-getters were Nick Kamau, Wendi Barish, Cateria R. McCabe, Betsy Wahl, Chris Hall, Craig Levin, Michele Hangley, and Daniel R. Sulman. All but Hangley were endorsed by the Democratic City Committee.

In the Democratic primary for Philadelphia Municipal Court, four candidates ran for three spots. Michael C. Lambert, Greg Yorgey-Girdy, and George Twardy were leading, according to unofficial returns.