A US judge blocked the Trump administration on Monday from conditioning counterterrorism funds to state and local governments on changes to election administration.

The decision by Washington-based US District Judge Amir Ali marks the latest defeat for President Donald Trump in his bid to increase the federal government’s authority over elections ahead of the November 3 midterms, when his Republicans are fighting to retain majorities in both houses of Congress.

Earlier this year, the Department of Homeland Security announced that it would withhold 20 per cent of funding under grant programmes related to preparing for terrorist attacks and other threats until state or local governments adopted election administration measures favoured by the administration.

In his ruling on Monday, Ali sided with counties and cities in Texas, Ohio and Tennessee, which sued to block the changes on the basis that the conditioning of such funds exceeded the Federal Emergency Management Agency’s authority. A coalition of mostly Democratic-governed states filed a separate legal challenge to the policy, which remains pending.

The grant programmes, totalling about $1.1 billion, have existed for years. None of them were designed with election security specifically in mind.

“Congress did not authorise the grant programme to be used for the sort of election administration reforms FEMA demands here – changes that, whether sound or not as a matter of policy, are not advanced to prepare for or respond to ‘acts of terrorism,’” wrote Ali, an appointee of Democratic President Joe Biden.

Neither DHS nor the Justice Department, which represents the federal government in court, immediately responded to requests for comment.

In announcing the plan to condition the funds, DHS Secretary Markwayne Mullin said the new requirements would protect election systems from foreign interference and cyberattacks.

The plan would have required grant recipients to use equipment that accepts hand-marked paper ballots rather than electronic voting systems, manually audit at least 5 per cent of ballots cast, and compare their voter rolls to a DHS database to make sure no noncitizens were registered to vote.

Trump has long made false claims about widespread voting fraud in US elections including the 2020 presidential election that he lost.

Independent studies and audits have found voter fraud to be rare.