(This March 14 story corrects paragraph 15 to add dropped words “not” and “whether” to show Pennsylvania has not provided funding)

FILE PHOTO: Democratic congressional candidate Conor Lamb fills out his ballot on a voting machine in Mt. Lebanon, Pennsylvania, U.S., March 13, 2018. REUTERS/Brendan McDermid/File Photo

WASHINGTON (Reuters) - Pennsylvania’s tight congressional special election underscores the need for states to replace aging voting machines and use paper ballots as backups to ensure the integrity of vote counts ahead of pivotal November U.S. midterm elections, election security advocates said on Wednesday.

Democrat Conor Lamb led Republican Rick Saccone by only a few hundred votes out of nearly 230,000 cast in the closely watched U.S. House of Representatives election on Tuesday in western Pennsylvania.

With many states using antiquated voting machines and with concerns about potential interference in U.S. elections by Russia or other actors, there is rising concern among experts about the need to safeguard American balloting.

“At the end of the day, the winners need be assured that they won and the losers need to know that they lost,” said former Pennsylvania election official Marian Schneider, president of Verified Voting, a group that advocates for auditable elections.

While there have been no issues raised about the integrity of the Pennsylvania race, election security experts said the razor-thin margin highlighted the importance of protecting voting machines from tampering, failure or human error.

“Whenever you are talking about computers, there are risks” of tampering or programming error, Schneider said.

In the face of federal inaction on election security, nearly every state has taken steps since the 2016 election to purchase more secure equipment, expand the use of paper ballots, improve cyber training or seek federal assistance, according to groups that track election security.

Voting systems that do not produce a paper backup of a ballot, which election officials can use to check electronic tabulations, are more difficult to audit for signs of tampering or error, according to experts.

The four counties where voters cast ballots on Tuesday are among the 50 Pennsylvania counties, out of a total of 67, that use voting machines without an auditable paper trail, according to Verified Voting.

“With paper, you can recount or audit that paper and carefully check the performance of the voting system, ensuring that the electronic result would match what a full hand count would show,” said Joseph Lorenzo Hall, an election security expert with the Center for Democracy & Technology.

“Without a paper audit trail, any recount is just like hitting enter on the keyboard over and over again: You get the same answer and you have no clue if that answer is correct,” Hall added.

PROBING BY RUSSIA

The Department of Homeland Security said last year that 21 of the 50 states had experienced initial probing of their election systems from Russian hackers and that a small number of networks were compromised, but that there remains no evidence any votes were actually altered.

U.S. intelligence agencies previously concluded that Russia interfered in the 2016 election through a campaign of propaganda and hacking to help Trump win. Russia has denied this.

Pennsylvania Governor Tom Wolf, a Democrat, last month issued a directive requiring new voting machines in the state to have paper records of votes cast. Pennsylvania has not provided funding for counties to buy new equipment, making it unclear whether existing systems will be replaced before the November elections.

President Donald Trump, who in the past has raised questions about the integrity of American elections, endorsed the paper backups in elections as useful to protect against Russian meddling. Trump said at a news conference last Thursday that “it’s old-fashioned, but it’s always good to have a paper back-up system of voting.”

But Congress, controlled by his fellow Republicans, has not provided funding to states to upgrade voting machines.

Democrats have introduced election security legislation and called for congressional hearings. Congressional Republicans have not acted on warnings from senior U.S. intelligence officials who said Russia is likely to target November’s midterm races in which Democrats are trying to seize control of the House of Representatives and Senate.

Some experts have warned that voter confidence could be undermined if states do not install newer machines that can be audited with a paper trail.

New Jersey, Delaware, Georgia, Louisiana and South Carolina have no verifiable paper ballot backup across their states, though some are looking to purchase systems that provide such audits. Eight other states, including Pennsylvania, have some electoral districts without paper backups.