Update, March 14, 2018: The Democrat Conor Lamb has an insurmountable lead in a Pennsylvania House race in Trump country. We’re calling it in his favor.

CANONSBURG, Pa. — The Democrat and Republican in a special House election in the heart of Pennsylvania’s Trump country were divided by a few hundred votes in a race that was too close to call early Wednesday — an ominous sign for Republicans in a district that Donald J. Trump won by nearly 20 percentage points.

With 100 percent of votes counted, Conor Lamb, a Democrat, was clinging to a 641-vote lead over Rick Saccone, a Republican. But one county in the four-county district had not yet counted its absentee ballots, so no winner had been declared as of Wednesday morning. And it was possible that, if Mr. Saccone challenged the results, a legal battle could ensue.

Taking the stage to applause at 12:45 a.m., Mr. Lamb was introduced as “Congressman-elect” and exulted, “It took a little longer than we thought, but we did it!”