Democrat Conor Lamb declared victory early Wednesday in Pennsylvania’s special House election that was officially too close to call but seen by some political observers as a clear message to Republicans prior to November’s midterm elections.

The most recent results — with 99 percent of the precincts reporting — show Lamb up by fewer than 900 votes over Republican Rick Saccone. State officials said there were about 3,900 absentee ballots that still needed to be counted.

The final result may be determined by a recount.

Still, the unofficial results showed Lamb riding a wave of Democratic enthusiasm in a district that President Donald Trump won 16 months ago by 20 points. The result was expected to raise Democratic hopes of taking back the House in November.

“It took a little longer than we thought,” Lamb, a former Marine, told supporters. “We followed what I learned in the Marines – leave no one behind. We went everywhere; we talked to everyone; we invited everyone in.”

Saccone appeared more cautious after polls closed. He told an audience that he doesn’t give up. He thanked the crowd that he called “the salt of the earth” and vowed that he is going to keep fighting.

To be sure, Democrats wasted little time to celebrate the outcome.

The Democratic Congressional Campaign Committee and Democratic National Committee both issued statements late Tuesday declaring victory.

This is a local race ... I don't think it has anything to do with the president. — Conor Lamb, Democratic House candidate

“These results should terrify Republicans. Despite their home field advantage and the millions of dollars outside groups poured into this race, Republicans found that their attacks against Conor, including their unpopular tax scam, were not believable,” Ben Ray, the DCCC chairman, said in a statement.

Tom Perez, the DNC chair, praised the “victory,” saying the upset was for “hardworking families of Western Pennsylvania and a victory for Democrats across the country.”

Lamb, a 33-year-old former federal prosecutor, ran up big margins against Saccone, 60, in wealthy Allegheny County and was holding his own in GOP-leaning Westmoreland, Washington and Greene counties.

Pennsylvania Secretary of State Wanda Murren told Fox News the race would not have a mandatory recount. Under state law, three voters in each precinct must petition for a recount and petitions must be filed five days after each county completes its tally.

Lamb insisted that Trump was not the main issue in the race. But the close margin was another setback for the president following Democratic Sen. Doug Jones' victory in Alabama's special election in December.

“We were executing a plan that we came up with a long time ago that had nothing to do with the president,” Lamb told reporters after voting Tuesday morning. “This is a local race. … I don’t think it has anything to do with the president.”

By contrast, Saccone had vowed that he would be Trump's "wingman," telling Fox Business Network's "Mornings with Maria" that the president "needs some help down there [in Washington]."

The president visited the district twice to campaign for Saccone, once in January and again on Saturday night in a rollicking rally that recalled Trump’s own 2016 campaign.

In a bid to lock up that key voting bloc, Democrats called in former Vice President Joe Biden to stump for Lamb.

“You said you want your piece of the sidewalk,” Biden, a potential 2020 presidential candidate, told a group of union workers last week. ”Hell, you own the sidewalk.” Biden has also said that Lamb reminds him of his late son, Beau, an Iraq War veteran and former Delaware attorney general who died of brain cancer in 2015 at age 46.

Pennsylvania's 18th Congressional District, which stretches from the affluent Pittsburgh suburbs into deep Pennsylvania steel and coal country, had been held by Republican Tim Murphy since 2003. But Murphy was forced to resign in October amid revelations of an extramarital affair in which he urged his lover to get an abortion when they thought she was pregnant.

Lamb and Saccone could face off again in November – though they may not meet in the same district. In January, the Pennsylvania Supreme Court ruled that the state’s congressional district boundaries were unfairly gerrymandered to aid Republicans.

The Democrat-controlled court has drawn a new map that puts Saccone and Lamb’s homes in separate districts. However, the matter is now in the hands of a three-judge federal panel, which is considering an appeal by Republican lawmakers.

Fox News' Bret Baier, Joseph Weber and the Associated Press contributed to this report.