(Reuters) - A federal judge struck down a Kansas law requiring proof of U.S. citizenship to register to vote in a decision on Monday that could make voter registration easier in the state in the run-up to November mid-term elections.

FILE PHOTO: Kansas Secretary of State Kris Kobach talks about the Kansas voter ID law that he pushed to combat what he believes to be rampant voter fraud in the United States in his office in Topeka, Kansas, U.S., on May 12, 2016. REUTERS/Dave Kaup/File Photo

The ruling ended a two-year legal battle in which Democrats argued that such ID laws targeted voters who typically support their party, such as the young and minorities. Republican proponents of the law said it was necessary to ensure the integrity of elections.

It was one of numerous voter ID laws passed by Republican-led state legislatures in recent years.

Supporters of the law included Kansas Secretary of State Kris Kobach, one of the United States’ most prominent voter fraud crusaders and an adviser to President Donald Trump on the issue.

Judge Julie Robinson found that the law “disproportionately impacted duly qualified registration applicants, while only nominally preventing noncitizen voter registration.”

She ordered Kobach, who is seeking the Republican nomination for Kansas governor, to take more hours of continuing legal education after she found him in contempt of court during the trial and chided him for legal missteps.

Kobach’s office did not respond immediately to a request for comment.

The American Civil Liberties Union (ACLU) filed suit in February 2016 challenging the Kansas law as a violation of the National Voter Registration Act, which allows individuals to register to vote at state motor vehicles offices with no more documentation than they would need to obtain a driver’s license.

The law, which took effect in 2013, required individuals to present a U.S. passport, birth certificate or other proof of citizenship in order to register to vote.

“These requirements have had one purpose only - to decrease citizen participation in Kansas elections, in ways that weaken our democracy,” the ACLU said in a statement in response to Robinson’s ruling.

Kobach argued during the trial that 129 non-U.S. citizens had voted or registered to vote in Kansas since 2000, a number he said was merely the “tip of the iceberg.”

Trump has contended, without evidence, that millions of people voted illegally in the 2016 presidential election he won. Most state election officials and election law experts say that U.S. voter fraud is rare.