The Democrat Conor Lamb is close to pulling off a remarkable victory in Pennsylvania's 18th Congressional District.

With 100% of Election Day votes counted and only absentee and provisional ballots left, the race is too close to call, with only 579 votes separating the candidates.

Lamb, however, declared victory in the wee hours of Wednesday morning.

President Donald Trump won the district by 20 points in 2016.

The US House candidate Conor Lamb is close to pulling off an improbable win, keeping Democrats' momentum going Tuesday as he led the Republican Rick Saccone in the special election for Pennsylvania's 18th Congressional District.

With 100% of precincts reporting, and only absentee and provisional ballots left to count, Lamb held a lead of more than 600 votes over Saccone.

Saccone would need a real boost in the remaining absentee ballots to leapfrog Lamb, but he is not conceding the race, which has yet to be officially called, as of Wednesday morning. The Democratic Congressional Campaign Committee has already declared victory for Lamb, with Rep. Ben Ray Lujan of New Mexico, the chair of the DCCC, saying the results "should terrify Republicans."

Just before 12:45 a.m. ET on Wednesday, Lamb declared victory at his election event.

"It took a little longer than we thought, but we did it," he said.

The National Republican Congressional Committee's communications director, Matt Gorman, said in a statement that the "race is too close to call and we're ready to ensure that every legal vote is counted."

"Once they are, we're confident Rick Saccone will be the newest Republican member of Congress," Gorman said.

Polls heading into Tuesday showed a tight race in a district President Donald Trump won by 20 points in 2016, with some showing Lamb, a Marine veteran and former federal prosecutor, ahead significantly. The seat became open after the longtime Republican Rep. Tim Murphy resigned from office late last year following an abortion-related scandal.

Republicans went into the day blasting Saccone, a state legislator and Air Force veteran, whom they accused of running a subpar campaign in a race they increasingly expected to lose. Trump still enjoys decent approval ratings in the district, and he attempted to push Saccone over the top with a weekend visit.

"Conor Lamb is gonna win," a national Republican close to the race conceded to Business Insider hours before the polls closed. "I think it's been a race, since day one, about candidate disparity."

Results showed a significant shift toward the Democratic candidate when compared with the 2016 election:

Another Republican strategist close to the race cited the "disparity between the candidates having an outsized impact."

"Conor Lamb is exciting — he does break the mold a little bit," the strategist said. "And he does sound like the kind of Democrat that your typical voter in that sort of district could support. Saccone, unfortunately just has never been able to excite people in the district. His shortcomings were noticed by a handful of strategists early on."

Lamb has dominated the fundraising battle against Saccone, something Republicans highlighted as a significant problem for their candidate.

Rick Saccone. Brendan McDermid/Reuters Outside groups had sought to make up the fundraising difference by injecting money and support into the race. The Congressional Leadership Fund, for example, provided 50 door knockers and spent more than $3.5 million on the election effort. The race featured more than $12 million in spending on both sides, with the airwaves flooded with an inordinate number of ads.

Lamb's performance is of huge concern to Republicans heading into the 2018 midterms, which increasingly look as if they will be a challenging landscape for GOP House and Senate candidates. Traditionally, the first midterm elections under a new president go for the party out of the White House.

"It should serve as a wake-up call to everybody," one Republican strategist said of the race.

Lamb ran as a centrist Democrat, embracing gun rights, expressing opposition to abortion personally but supporting abortion rights, and saying he supported a middle-class tax cut though he vehemently opposes the Republican tax plan. Saccone pitched himself as "Trump before Trump" and sought to tie himself closely to the president and his agenda, which remain decently popular in the district.

Numerous policies were on the ballot as well, by proxy. This was the first major election since Republicans passed their tax overhaul. At the same time, Trump reportedly pitched his steel and aluminum tariffs with an eye on the race, hoping they could help prop up Saccone. But polling showed the tariffs did little to swing votes.

By a weird quirk, both Lamb and Saccone could be members of Congress by next January; the two are likely to run in different districts if they choose to seek office again because Pennsylvania's congressional map will be redrawn before this fall's races.