Israeli Prime Minister Benjamin Netanyahu suffered an electoral blow after his bill to have cameras installed in polling stations was rejected by a parliamentary committee.
The bill, widely viewed as aimed at Arab voters, followed claims by the prime minister's supporters that voting fraud took place in Arab districts.
Mr Netanyahu said the failure to monitor polling booths in Arab areas was a ploy by his opponents to “steal” the repeat election, scheduled for September 17.
A parliamentary committee voted against his last-minute bill that critics described as racist. They also accused Mr Netanyahu of promoting racism.
The deciding vote was cast by a representative of former Defence Minister Avigdor Lieberman, an ally-turned-rival of Mr Netanyahu who forced Israel's unprecedented second election of the year and is poised to be the kingmaker again.
With his career on the line, Mr Netanyahu has increasingly embraced some of the tactics of US President Donald Trump.
He routinely lashes out at the media, the judiciary, the police and his political opponents, claiming there is a conspiracy of "elites" to oust him. He is under investigation in three corruption cases.
In a Facebook video on Sunday, Mr Netanyahu hinted that voter fraud in Arab areas prevented him from winning the April vote.
His hard-line Likud Party sent out campaign workers on election day to videotape Arab voters entering polling stations, claiming they were preventing fraud.
Israel’s top legal authorities opposed Mr Netanyahu’s bill, which was backed by his government, but they later came under fire from the country’s increasingly mobilised right wing.
The Israeli leader criticised the country’s attorney general and a Supreme Court judge for resisting his bill.
But President Reuven Rivlin pushed back in a tweet supporting the officials.
“I support the members of the Central Elections Committee led by Supreme Court Deputy Chief Justice Hanan Melcer and Attorney General Avichai Mandelblit in the face of baseless and irresponsible political attacks they are experiencing,” Mr Rivlin tweeted.
“I reject with disgust the attempts to erode public trust in these bodies and institutions.”
Both officials had expressed concern that the bill, if passed, would harm the legitimacy of the vote.
“We must not defame the best of our public servants, who defend Israeli democracy and safeguard as much as possible the integrity of the elections,” Mr Rivlin said.
Adalah, a legal rights group for Arab minority rights, said even without being passed, Mr Netanyahu's bill had "already caused harm by injecting bald-faced lies into the public political discourse under the premise of preserving the 'purity of elections'."
Frustrating Mr Netanyahu once again was Mr Lieberman, who said any monitoring should be done by election officials and not "Netanyahu's private militia".
Mr Lieberman was once his chief of staff and a staunch partner.
He passed up the post of defence minister in Mr Netanyahu's government after April's election, leaving the prime minister without a parliamentary majority and forcing the September 17 repeat vote.
Opinion polls show Likud is in a neck-and-neck race with its main challenger, the centrist Blue and White party, with neither side able to secure an outright majority without the support of Mr Lieberman's group.