The Democratic Party and the presidential campaigns of Hillary Clinton and Bernie Sanders will sue the state of Arizona over voter access to the polls after the state’s presidential primary last month left thousands of residents waiting as long as five hours to vote.

The lawsuit, which will be filed on Friday, focuses on Maricopa County, the state’s most populous county, where voters faced the longest lines on March 22 during the Democratic and Republican primaries after the county cut the number of polling places by 85 percent since 2008.

Arizona’s “alarmingly inadequate number of voting centers resulted in severe, inexcusable burdens on voters county-wide, as well as the ultimate disenfranchisement of untold numbers of voters who were unable or unwilling to wait in intolerably long lines,” the lawsuit says.

The lack of voting places was “particularly burdensome” on Maricopa County’s black, Hispanic and Native American communities, which had fewer polling locations than white communities and in some cases no places to vote at all, the lawsuit alleges.

The lawsuit is calling on the U.S. District Court of Phoenix to review the polling location plan for the November election. It also wants to stop state policies that have a “dramatic and disparate impact” on minorities, who are more likely to vote Democratic, the lawsuit says. For instance, the filing cites a recently enacted law that makes it a felony for someone to turn in a sealed absentee ballot on behalf of another voter, unless the person is a caregiver or family member.

“Arizona has a history of problems with guaranteeing the rights of their citizens to vote, and with this lawsuit we hope to stop it now in time for the 2016 general election,” said Marc E. Elias, the elections lawyer for Clinton’s presidential campaign. Elias is bringing the lawsuit on behalf of the Democratic National Committee, the Democratic Senatorial Campaign Committee, the Arizona Democratic Party and several Arizonans.

The Clinton campaign will join the lawsuit after it is filed on Friday, according to Democratic officials. Sanders, the senator from Vermont who is running against Clinton for the party’s presidential nomination, is also joining the lawsuit, according to one of his senior aides. Clinton defeated Sanders by 20 points in the Arizona primary. Many Sanders supporters complained soon after that the long lines especially hurt support for the Vermont senator among young, new voters.

For Democrats, there is more at stake than the presidential race. Sen. John McCain (R-Ariz.) will probably face Rep. Ann Kirkpatrick (D-Ariz.), who has launched the most serious challenge to the longtime senator in years. The Kirkpatrick for Senate campaign will also be party to the lawsuit.

Arizona will be the fifth state that Elias is suing over voting issues following cases in Ohio, Virginia, Wisconsin and North Carolina.

“Increasingly, what we’ve seen over the last few years has been a wide-scale effort by Republicans in state after state to make voting harder,” said Elias, a veteran voting rights lawyer with the Washington office of law firm Perkins Coie.

Tracking the race to the Democratic nomination

This presidential race will be the first since a divided Supreme Court invalidated a key provision of the Voting Rights Act and triggered a number of states to pass stiffer requirements for voting. More-restrictive voting laws will be in effect in 17 states for the first time in a race for the White House.

During the Arizona Republican and Democratic primaries last month, Maricopa County cut the number of polling places from 400 in the contested primary of 2008 to 60 this year — for about 1.2 million voters, or one polling place per every 21,000 voters. All day, Arizonans waited for hours in long lines, some that stretched around the block.

“It was truly shameful,” said Leslie Feldman, 34, a plaintiff in the lawsuit who waited in an “extraordinarily long line snaking in, out and around” a Phoenix church for 4  1/ hours with her 3  1/2 -year-old daughter and 12-week-old infant. When she finally got inside the church, she said, there were no Democratic ballots and she had to wait another 25 minutes for more to be delivered.

The day after the primary, Republican Gov. Doug Ducey called the long lines “unacceptable.” Phoenix Mayor Greg Stanton wrote a letter to Attorney General Loretta E. Lynch asking the Justice Department to investigate the “fiasco.”

“Throughout the county, but especially in Phoenix, thousands of citizens waited in line for three, four and even five hours to vote,” Stanton wrote. “Many more simply could not afford to wait that long, and went home. This is unacceptable anywhere in the United States, and I am angry that county elections officials allowed it to happen in my city.”

Earlier this week, senior Democrats on the House Judiciary Committee, along with top congressional leaders representing minority groups, also wrote to Lynch, urging the Justice Department to review the impact of voting restrictions across the country, specifically highlighting Arizona.

On April 1, Justice officials opened an investigation into the debacle in Maricopa County. In a request for information about the polling places and elections procedures, Chris Herren, chief of the civil rights division’s voting section, noted the “allegations of disproportionate burden in waiting times to vote on election days in some areas with substantial racial or language minority populations.”

A Justice Department investigation could drag on for many months and not be completed by the time of the Nov. 8 election.

It is also unclear whether the department has the evidence to file a lawsuit under Section 2 of the Voting Rights Act, which prohibits voting practices or procedures that discriminate on the basis of race, color or membership in a language minority group.

Some Arizona officials said the primary problems were a miscalculation and an effort to save money.

“We made some horrendous mistakes, and I apologize for that,” Maricopa County Recorder Helen Purcell said during a contentious hearing in Arizona after the primary. Purcell, a Republican, said she made her decision based on numbers from the 2008 presidential primary and thought many people would mail in ballots rather than vote in person.

She also said it was a cost-
saving measure because the legislature had not given her county enough money to administer the election.

Arizona’s election laws and practices were once overseen by the Justice Department, which had to approve any changes made by the state under the Voting Rights Act because of Arizona’s history of discrimination against minorities.

That requirement was lifted in 2013 in a landmark Supreme Court ruling that in essence took away the power of the Justice Department to challenge potentially unfair voting laws in 15 states before they are enacted.

The court said Congress must come up with a new formula based on current data to determine which states should be subject to that requirement. Congress has not yet acted.

Since that ruling, Arizona and Maricopa County specifically have engaged in “consistent activity that has created a culture of voter disenfranchisement,” the lawsuit says.

“Arizona has been a flash point for voting rights for a while,” said Wendy R. Weiser, director of the Democracy Program at the Brennan Center for Justice at the New York University School of Law.

She said Arizona was the first state to require documentary proof of citizenship from its voters, a practice that has also been adopted by Kansas, Georgia and Alabama.

The lawsuit being filed this week also contests a rule that does not count ballots cast in a precinct other than the one to which the voter is assigned.

With the election seven months away, the Democrats face a tight timeline for their lawsuits across the country to be resolved.

Two trials have been held before a federal judge on North Carolina’s law, which included a voter ID requirement. It also reduced the number of days of early voting, prohibited people from registering and voting on the same day, stopped ballots cast in the wrong precinct from being counted, and ended the practice of preregistering teenagers before they turned 18.

A decision could come any day, and the case could be appealed to the U.S. Court of Appeals for the 4th Circuit.

In the Ohio voting rights case, a trial was held in November, and appeals in that case also are likely when a ruling is made.

A decision is expected in mid-May in the Virginia voter ID challenge, with possible appeals.

And a trial is scheduled in May for the Wisconsin lawsuit, which challenges reductions in early voting, restrictions on voter registration and the voter ID requirement.

The Arizona case faces the tightest deadline, especially in light of what is known as the Purcell doctrine from a Supreme Court case. It states that courts should not issue an opinion in an election case too close to Election Day if it will cause voter confusion.

“While it is April before a major election, the fact is that courts know how to expedite cases such as this to ensure that the people of Arizona receive the relief necessary to ensure that all their votes count,” Elias said.