WASHINGTON (Reuters) - Democrats’ quest to take control of the U.S. House of Representatives and stymie President Donald Trump’s agenda began in earnest on Tuesday after voters in Pennsylvania chose a slate of nominees to compete in a pivotal battleground state.

Democrats must wrest 23 seats nationwide from Republicans to take over the House, and analysts say the party could gain as many as five seats in Pennsylvania alone in the general congressional election in November.

The most closely watched race was in the district around Allentown, Pennsylvania, where a bevy of Democrats battled to replace incumbent U.S. Representative Charlie Dent, one of the few remaining moderate Republicans in the House.

The Democratic field in that contest was viewed as a conflict between the progressive and centrist wings of a party still trying to find its footing in the Trump Era.

As it turned out, the most traditional Democrat in the race, Susan Wild, who was endorsed by the influential advocacy group Emily’s List, won the nomination, narrowly edging moderate John Morganelli, who opposes abortion rights.

The liberal political-action group NextGen America, backed by activist Tom Steyer, worked to defeat Morganelli and said in a statement that Wild’s victory showed Democrats that “to win elections, we don’t need to moderate our vision or accept compromise on our fundamental values”.

Scott Wallace won the nomination in another district northeast of Philadelphia that Democrats hope to turn. Wallace will face vulnerable Republican incumbent Representative Brian Fitzpatrick.

Slideshow ( 6 images )

Democrats are also expected to win three contests in districts in suburban Philadelphia that have been redrawn to favor them.

Madeleine Dean, a state representative, Air Force veteran Chrissy Houlahan and lawyer Mary Gay Scanlon won the nomination in their respective districts. Currently, there are no women representing Pennsylvania in the House.

Pennsylvania’s politics were thrown into turmoil this year when the state Supreme Court found that its congressional districts had been unconstitutionally tailored to favor Republicans. The redrawn map has made some districts more competitive.

In addition, six incumbent House Republicans are not running for re-election, further scrambling the races and requiring voters to become familiar with a raft of first-time candidates.

As for the Senate, U.S. Representative Lou Barletta won the Republican nomination to battle incumbent Democrat Bob Casey in the fall. Barletta was an early supporter of Trump’s presidential bid and has fervently embraced the president’s policies.

Democrats must hold Casey’s Senate seat and those of other incumbents and pick up two currently held by Republicans to seize control of that chamber.

Beyond Pennsylvania, Democratic hopes of taking a Nebraska House seat might have been dealt a blow after progressive Kara Eastman won a primary race against former congressman Brad Ashford, who was backed by the national party.

Eastman, who centered her campaign around establishing a national single-payer health-care system, will face incumbent Republican Don Bacon this fall to represent an Omaha-area district that is viewed as perhaps too moderate for a candidate such as her.