PHOENIX (Reuters) - An Arizona man filed a lawsuit on Friday challenging the results of the state’s March presidential primary election, alleging misconduct by officials during a nominating contest that is already mired in controversy.

People wait to vote in the U.S. presidential primary election at a polling site in Glendale, Arizona March 22, 2016. REUTERS/Nancy Wiechec

The lawsuit filed by Tucson resident John Brakey alleges that officials improperly handled voter registration requests and permitted illegal votes to be cast in the election, which was marred by long lines at polling stations and allegations of discrimination against minority voters.

The three-count complaint, filed late on Friday afternoon against Arizona’s secretary of state and 15 counties, also claims that erroneous ballots were counted by officials on election day.

It seeks to enjoin the state from certifying the results “until such election is properly conducted and in compliance with every requirement of Arizona law,” according to the lawsuit.

The legal action comes amid an investigation by the U.S. Department of Justice into the election’s handling by Maricopa County officials that saw outraged votes wait up to five hours to cast their ballots at polls.

Some county residents waited long after the polls had officially closed and projected results announced to vote at one of 60 election sites, a reduced number of locations made in cost-cutting efforts by officials. Two hundred polls were set up for the same election in 2012.

Officials immediately took the blame for misjudging the number of people who would show up at the polls to cast ballots, saying that their decision were based on turnout history and an increase in mail-in voters.

U.S. Justice Department officials are investigating whether federal voting laws were violated after complaints of long lines at polling stations and allegations that there was disproportionate waiting times in areas with high numbers of minority people.

Maricopa County officials have until April 22 to respond to the questions from the head of the voting section of the department’s civil rights division.

Such an investigation was requested by Phoenix Mayor Greg Stanton, who called the March 22 election won by Democrat Hillary Clinton and Republican Donald Trump “a fiasco” that was unacceptable.

A hearing on the lawsuit has been set for April 19.

(Corrects headline and first two paragraphs to show lawsuit alleges official misconduct over voter registration requests, not lines at polling stations or possible discrimination against minority voters)