An election in Pennsylvania for a United States House of Representatives seat, seen as a bellwether of national sentiment, is too close to call.

The special election race was a dead heat, with a moderate Democrat and a Republican backed by President Donald Trump running neck and neck.

With the votes from 97 per cent of precincts counted, Democrat Conor Lamb led Republican Rick Saccone by just around half of a percentage point.

The district has long been a white, working-class Republican stronghold.

Mr Trump won the 2016 presidential election there by almost 20 percentage points.

But Mr Lamb, a 33-year-old Marine veteran, surged in polls in recent weeks as Democrat voters sensed a chance to show their opposition to Mr Trump.

The race is also seen as a harbinger for midterm elections in November when Democrats will try to win control of the US Congress from Republicans.

Mr Saccone, 60, a conservative who has described himself as "Trump before Trump was Trump," led the race by more than 10 percentage points in January.

Republican dominance has been so strong in the district that Democrats ran no candidates in the previous two US House elections, even though state voter registration records show Democrats outnumbering Republicans.

The White House arranged a string of visits to energise Mr Saccone supporters.

Mr Trump himself visited twice, including holding a campaign rally last weekend, and on Tuesday he again voiced backing for the Republican.

World partners:

This service includes material from AAP, Agence France-Presse, APTN, BBC, CNN, Getty, Pacnews, Reuters and other agencies which is copyright and cannot be reproduced, broadcast, rewritten or redistributed without written consent.