PITTSBURGH — Republican officials are alleging voting irregularities in the District 18 special election, and say they plan to go to court seeking to impound all the voting machines used Tuesday.

Democrat Conor Lamb of Mt. Lebanon holds a slim lead over Republican state Rep. Rick Saccone of Elizabeth Township. With a few absentee and provisional ballots still out, his lead is a few hundred votes out of more than 200,000 cast in the congressional district formerly held by Republican Tim Murphy.

The seat had been safely Republican for more than a decade and national Republican organization spent millions supporting  Saccone. But Lamb mounted a strong challenge and remained ahead in the vote count Wednesday morning.

A Republican source familiar with the campaign said that the GOP planned to petition for the voting machines used in all four counties to be impounded, pending a recount.

>> READ MORE: Pa. 18 congressional district results and updates: Democrat Conor Lamb maintains lead with absentee votes counted

It is not yet clear where such a petition would be filed. But Republicans are investigating a number of purported Election Day irregularities including problems with the machines, voters being told to go to the wrong polling places, and Republican attorneys being barred from overseeing the counting of absentee ballots in Allegheny County.

County spokeswoman Amie Downs said that on Election Day there had been discussions with Republican attorneys about their ability to oversee the vote-counting process. Under the state Election Code, she said, such observers must have a signed authorization from the chair of the county committee. "They didn't produce that until the very end of the evening, when the ballots had already been scanned," she said.

Mark Wolosik, who directs the county's elections office, said that late Tuesday morning, "a call came in asking about people being able to observe the [counting] process on Election Night."

Usually, he said, "people ask ahead of time" rather than on Election Day itself.

>> READ MORE: Why the tight House race in Western Pa. should worry Trump and the GOP

Phone messages were exchanged over the following hours, and eventually two Republican attorneys arrived at the central tabulation center, located in Pittsburgh. Wolosik said that an attorney identified himself as being "from the Saccone campaign" but the Election Code only allows political parties, not candidates, to deputize observers. A lawyer later produced an email purporting to show such authorization, but Wolosik said he couldn't accept that because "there was no signature." He swore in the observer after receiving a signed authorization.

The absentee ballots themselves are run through an optical scanner that records the vote, and the ballots are preserved afterward, meaning a recount is possible should one be ordered. Ordinarily, for both absentee and in-person voters, election workers compare the number of votes cast to the number of voters logged in by poll workers on Election Day, to make sure the numbers correspond. Court challenges could of course complicate that process, but otherwise, "if there's no discrepancy on the face, then we accept the count as accurate," Wolosik said

Ultimately, the count is certified by the Board of Elections, which consists of Allegheny County Exeuctive Rich Fitzgerald and the two at-large members of Allegheny County Council: Democrat John DeFazio and Republican Sam DeMarco. The board is  slated to meet April 2.

D. Raja, the chair of the Republican Committee of Allegheny County, did not immediately return a call for comment Wednesday morning.

Downs added that prior to providing the authorization, the Republican observer was allowed to watch from the doorway, and that the Democrats had no observers on hand for the ballot counting in Washington County.

There were numerous reports Tuesday of voters being confused about whether they lived within the 18th Congressional District, whether as a result of a saturation-bombing TV campaign or of confusion stemming from a court battle over whether district lines should be redrawn later this year.

But Allegheny County reported only a couple isolated problems with voting machines, including low battery power and a blank screen on one machine. There were no reports of "calibration errors," Downs said, in which touching the screen in one place results in a box elsewhere being checked.