A Philadelphia judge and a deputy district attorney in Chester County were among those in contention Tuesday night in the primary elections for a powerful statewide appellate court.

Voters selected two candidates from each party in the Superior Court primaries. With more than 90 percent of districts reporting at 11 p.m., Amanda Green-Hawkins, a Pittsburgh lawyer for the United Steel Workers union, was leading the Democratic primary.

Philadelphia Common Pleas Court Judge Daniel McCaffery, a former assistant district attorney, was in second, and was closely followed by Allegheny County attorney Beth Tarasi.

In the GOP primary, the leading candidate was Megan McCarthy King, a deputy district attorney in Chester County, followed by Cumberland County Common Pleas Court Judge Christylee Peck. Rebecca Warren, a former Montour County district attorney, trailed.

The four leading candidates each had been endorsed by their respective parties. The Pennsylvania Bar Association had declined to recommend Green-Hawkins, citing her relative inexperience in the courtroom.

>> READ MORE: In Montgomery County, some voters concerned by new paper ballots

King got a lift from the White House. “She is tough on crime and fully understands all aspects of the law,” President Donald Trump wrote on Twitter Monday night after his rally in Lycoming County, Pa.

The nominees will compete for two open seats on the court in the Nov. 5 general election.

McCaffery had raised more than $240,000 as of May 6, the most of any candidate for Superior Court. His campaign was largely funded by labor unions. McCaffery is the brother of former state Supreme Court Justice Seamus McCaffery, who resigned in 2014 amid the email scandal known as Porngate.

Judges on Superior Court, one of two statewide appellate courts, earn an annual salary of $199,114 and serve 10-year terms, after which they face uncontested retention elections. The court handles appeals of criminal and civil cases, as well as appeals of cases involving families and children.

>> READ MORE: How do judicial elections in Philadelphia work and why do we vote for judges?

Voters on Tuesday also nominated candidates for Philadelphia Common Pleas Court, which handles major criminal and civil cases, and Municipal Court, which handles misdemeanor trials and small claims, among other cases.

With 25 candidates running for six spots in the Democratic primary for Common Pleas Court, most if not all of them largely unknown to the electorate, ballot position and party endorsements were expected to be big factors.

>> READ MORE: How ballot position can sway Philly elections — and why new voting machines won’t be a fix

With 97 percent of precincts reporting, the candidates with the biggest share of the vote were Jennifer Schultz, an attorney with Community Legal Services; Anthony Kyriakakis, a lawyer with Dilworth Paxson LLP and a former federal prosecutor; Joshua Roberts, a partner at Datz & Roberts LLC; Tiffany Palmer, a founding member of Jerner & Palmer PC and director of the Family Law Institute of the National LGBT Bar Association; James C. Crumlish, senior shareholder with Elliot Greenleaf; and lawyer Carmella Jacquinto.

Kyriakakis, Roberts, and Jacquinto were endorsed by the Democratic City Committee. Beth Grossman, a former GOP nominee for district attorney, was the lone Republican on the ballot. She also ran as a Democrat — not unheard of in a city where Democrats far outnumber Republicans.

Each of the leading candidates had been recommended by the Philadelphia Bar Association, which evaluates candidates based on criteria such as temperament and trial experience.

>> ANALYSIS: Philly primary shows the power and limitations of incumbency in city’s politics

Judges on Common Pleas Court serve 10-year terms and earn an annual salary of $183,184, while Municipal Court judges serve six years and earn $178,946 a year.

Two candidates, both Democrats, ran for Municipal Court. David Conroy was leading Theresa Brunson as of 11 p.m. Tuesday.