PHOENIX (Reuters) - A judge on Tuesday tossed out a legal challenge to a problem-plagued presidential preference election in Arizona, ruling that the woes at the polls were not due to fraud.

Maricopa County Superior Court Judge David Gass said there were insufficient grounds for granting the request to void the results of the March 22 nominating election, which was marked by long lines and controversy.

In a ruling from the bench, Gass said there were glitches and possible missteps by election officials but that the results would not have changed.

“Elections are human endeavors. They are never, ever perfect,” Gass said. “Glitches are always something that we need to wary of and we need to work hard, and we need to fix them.... But they don’t rise to the level of fraud.”

Gass issued his verbal decision following a two-day hearing on the lawsuit brought by Tucson resident John Brakey, who alleged that election officials committed misconduct.

The lawsuit argued officials improperly handled voter registration requests and permitted illegal votes to be cast in the election. He also said erroneous ballots were counted and the number of polling locations were inadequate.

He sought a repeat of the election, easily won by Democrat Hillary Clinton and Republican Donald Trump.

Brakey’s attorney Michael Kielsky told Reuters on Tuesday night that he was disappointed in the ruling, but that it likely will not be appealed.

The election brought widespread criticism to Arizona, which saw frustrated voters wait in line for as long as five hours to cast their ballots at a drastically reduced number of polls.

In a cost-cutting move, county election officials slashed the polling locations to 60, compared with 200 in the election in 2012.

Officials immediately took the blame for the mistake, saying the decision was based on past voter turnout and an increase in mail-in votes.

The election also faces a separate federal court challenge by the state and national Democratic parties, along with the Clinton and Sanders campaigns.

Justice department officials additionally have launched a probe into the handling of the election.