MOUNT LEBANON, Pa. — A special election for a US House seat was too close to call early Wednesday as Democrat Conor Lamb and Republican Rick Saccone were separated by several hundred votes in a race that had become a test of President Trump’s political clout.
With several thousand absentee and provisional ballots outstanding, Lamb earned 49.8 percent of votes cast and Saccone earned 49.6 percent, with 100 percent of precincts reporting according to the Associated Press, which said the race was too close to project a winner.
A recount is possible if the candidates are separated by 0.5 percentage points or less.
Shortly before midnight, Saccone told his supporters that ‘‘it’s not over yet.’’
At Lamb’s party, exhausted backers groaned when told to keep waiting for more ballots to be counted. Rich Fitzgerald, the Democratic Allegheny County executive, offered an upbeat assessment. ‘‘We like where we are,’’ Fitzgerald said.
Confident that the absentee ballots would not erase the lead held by Lamb, the Democratic Congressional Campaign Committee declared victory for him; the National Republican Congressional Committee said it was confident of a Saccone victory ‘‘after every legal vote is counted.’’
Lamb, 33, had waged an energetic campaign in the district that Trump carried by nearly 20 points in 2016 but that opened up after the Republican incumbent was felled by scandal. Republicans cited that scandal, along with the lackluster campaign of their nominee, Rick Saccone, to minimize the closeness of the race. The district itself will disappear this year, thanks to a court decision that struck down a Republican-drawn map.
But led by the White House, Republicans had elevated the race to a high-stakes referendum on the president and the GOP. Trump made two appearances with Saccone, including a Saturday-night rally in the district, and his son Donald Trump Jr. stumped with the Republican on Monday. The president repeatedly linked his brand to Saccone.
‘‘The Economy is raging, at an all time high, and is set to get even better,’’ the president tweeted on Tuesday morning. ‘‘Jobs and wages up. Vote for Rick Saccone and keep it going!’’
Republican campaign committees and super PACs spent $10.7 million to help Saccone, more than five times as much as their Democratic rivals, according to Federal Election Commission records filed Monday night.
Thanks to the court’s scrambling of the congressional map, both Lamb and Saccone may well become candidates in new districts before a winner is declared in the 18th Congressional District. Candidates must collect and file 1,000 signatures for those races by March 20, the day that some overseas ballots in Tuesday’s race will be counted.
The district, a stretch of suburbs and small towns that was drawn to elect a Republican, was not the sort of place that Democrats had been expected to make competitive this year. Lamb’s coalition pulled together suburban liberals, wayward Republicans and traditional Democrats who had drifted from the party on cultural issues.
The tight race added to Republican woes on a day that began with the surprise firing of Secretary of State Rex Tillerson and a string of related dismissals. Republicans who hoped to fight the Pennsylvania race on the growing economy, and on the president’s new tariffs on foreign steel and aluminum, found the White House frequently alienating some of the voters they needed.
As voters made their decisions Tuesday, Trump loomed large in the minds of many.
Amelia Fletcher, a registered independent from Moon Township, cast her first-ever ballot for Saccone because she likes Trump’s agenda and believes he will support it.
‘‘I really don’t appreciate how he talks, but I like what he’s doing now to help us out,’’ the 18-year-old high school senior said of Trump.
In Mount Lebanon, Dave Banyan, 65, said that he had made up his mind on the race ‘‘as soon as President Trump was President Trump.’’ He said he did not want Democrats to get one vote closer to controlling the House of Representatives.
‘‘I don’t want America to go back to the way it was’’ under President BaraObama, said Banyan, a retired transportation worker. ‘‘Obamacare killed me. Dreamers — keep dreamin’, you know?’’
However, several voters who said they were Republicans were casting their ballots for Lamb and against Trump.
Janet Dellana, 64, said that Lamb had impressed her as a candidate and that ‘‘national politics’’ had already been moving her toward the Democrats.
In the wake of school shootings across the country, Dellana said she had been outraged to see Trump call for arming teachers instead of limiting access to semiautomatic weapons.
‘‘He flip-flops on everything, but in the end, he caters to the extreme right,’’ said the dental hygienist. ‘‘I am a registered Republican, but as this party continues to cater to the extreme right, they push me left.’’
Mindy Barron, a 31-year-old ICU nurse from Greensburg, called Lamb ‘‘not a real hard-line Democrat.’’ A Republican, she supported Hillary Clinton for president in 2016 and said her choice to support another Democrat on Tuesday reflected dissatisfaction with Trump.
Lamb suits the district ‘‘really well,’’ she said, noting the area’s ‘‘strong red presence.’’
In addition to Trump’s rally to boost Saccone, the White House sent Vice President Mike Pence and White House advisers Kellyanne Conway and Ivanka Trump to the district. And Interior Secretary Ryan Zinke announced new funding for mine reclamation at a town just outside the district, with Saccone in attendance.
The Republican spent the final hours of the campaign on Monday evening with Donald Trump Jr., the president’s oldest son, rallying at a VFW hall in his home town of Elizabeth and warning fellow party members that ‘‘the left’’ was energized politically for all the wrong reasons.
‘‘I've talked to so many of these [people] on the left, and they have a hatred for our president,’’ Saccone said. ‘‘I'll tell you, many of them have a hatred for our country. ... My wife and I saw it again today. They have a hatred for God.’’
Lamb, voting shortly before 8 a.m. at his home precinct in Mount Lebanon, said he had ‘‘no idea’’ what Saccone meant and rebuffed claims that the election was a referendum on the White House.
‘‘People are voting for either me or Rick Saccone,’’ he said. ‘‘I don’t think it has a whole lot to do with the president.’’ Asked about the president’s new tariffs on steel and aluminum, Lamb emphasized that both he and Saccone had supported them.
Saccone voted Tuesday morning at Mount Vernon Presbyterian Church in McKeesport. Surrounded by reporters and television crews, he exited the polling place while on a video call with his son, an Air Force officer stationed in South Korea, declining to answer many questions.
‘‘Hey, son! Look at this — look at this mob!’’ Saccone said, turning his phone’s camera toward the crowd.
Robert Blose, a 68-year-old independent from Moon Township, cast his ballot for Saccone later in the day. The retired Marine said he did a lot of research on the two candidates and found himself questioning Lamb’s abilities and policy views.
‘‘I do think that he’s too inexperienced,’’ Blose said.
Blose expressed frustration with what he sees as Democrats picking and choosing which laws to enforce. ‘‘I believe in the rule of law,’’ he said.
Another political independent, 78-year-old Eugene Galiotto, supported Trump in 2016 and planned to vote for Saccone. But he said he changed his mind after seeing the bevy of negative political ads directed at Lamb in the race.
‘‘It disgusted me,’’ said Galiotto, a retired travel agency owner from Elizabeth Township. ‘‘I felt like I had to come out.’’
Lamb ran as a protector of Social Security and Medicare who wanted ‘‘new leadership’’ to replace House Democratic Leader Nancy Pelosi, D-Calif. In the closing days, national Republicans argued that he had blurred the lines between the parties, gaining on Saccone only because he did not sound like a Democrat.
‘‘He’s pro-gun, he’s pro-tariff, he’s pro-Trump, essentially,’’ Republican National Committee chair Ronna McDaniel said in a Monday radio interview. ‘‘It’s going to be a tight, tight race when you have two people running basically for the same party.’’
Republicans in Pennsylvania have run with a slightly different spin, emphasizing that registered Democrats slightly outnumber registered Republicans in the rural areas south and west of Pittsburgh.
The area covered by the 18th District had been trending Republican for decades. Republican candidates for president carried the district by larger and larger margins starting in 2004, peeling traditional Democrats away from their party on issues such as abortion and gun rights.
In Waynesburg, a fading mining town about 50 miles south of Pittsburgh, one registered Republican was still making his choice as he headed into his polling place.
‘‘What are you supposed to do?’’ Gary Wilson, 56, asked rhetorically, a few minutes before casting his ballot. ‘‘One’s a career politician and the other one is looking to make a career out of politics.’’
Wilson, a supervisor at one of the area’s remaining mines, ultimately voted for Saccone, but he offered only a squeamish endorsement of the president.
‘‘He can’t keep his big mouth shut, he can’t stop tweeting, and he can’t stop saying the wrong things at the most inopportune times,’’ he said. ‘‘And now we've got this Stormy Daniels nonsense. It’s almost like we’re waiting for the next dumb thing he’s going to do.’’
But ‘‘at least he’s doing something,’’ Wilson said after a pause. ‘‘It’s definitely not politics as usual.’’