Republicans filed a lawsuit Wednesday night to challenge the way some Arizona counties count mail-in ballots as election officials began to slowly tally more than 600,000 outstanding votes in the narrow U.S. Senate race — a task that could take days.

Republican Rep. Martha McSally and Democratic Rep. Kyrstin Sinema were separated by a small fraction of the 1.7 million tabulated votes.

About 75 percent of Arizona voters cast ballots by mail, but those ballots have to go through the laborious signature confirmation process, and only then can be opened and tabulated. If county recorders have issues verifying signatures they are allowed to ask voters to verify their identity.

The suit filed Wednesday by four county Republican parties alleges that the state's 15 county recorders don't follow a uniform standard for allowing voters to adjust problems with their mail-in ballots, and that two counties improperly allow those fixes after Election Day.

The GOP complained about the issue before Election Day and threatened to sue. Democrats alleged it was attempted voter suppression and that recorders have followed the same procedures for years with no issues. Republicans said it was about following the law and having a timely ballot count.

The sluggish count is a perennial issue for Arizona, but has rarely received such a high level of attention because the GOP-leaning state generally has had few nationally-watched nail-biting contests.

The lawsuit alleges that signature verification must stop when polls close, and seeks an injunction to stop the counting of such ballots that have been verified after then. It's unclear how many of these votes still remain outstanding, but the suit singles out the state's two biggest urban counties, the center of support for Sinema. It says the two counties allow voters to help clear up signature problems up to five days after the election.

Democrats believe the uncounted urban ballots dropped off shortly before Election Day favors Sinema.

The lawsuit is scheduled to be heard Friday, after the next release late Thursday of tallied ballots.

It's one window into the complexities of mail ballots and the so-called "late earlies" that arrive just before Election Day and regularly gum up the state's vote counting system.

This election featured heavy statewide turnout of about 60 percent, more in line with a presidential election than a midterm — part of the reason county registrars were overloaded with uncounted ballots.

One candidate familiar with the long wait is McSally. It took The Associated Press 12 days to name her as the loser of her first congressional race in 2012 because the margin was so narrow and vote counting was slow. McSally's second and successful bid for the seat ended with a recount in December of 2014, more than one month after the election.

McSally tweeted early Wednesday that she was going "to bed with a lead of over 14,000 votes."

She added: "We're confident tomorrow will bring more good news."

Sinema tweeted that the "race is about you and we're going to make sure your vote is counted. There are a lot of outstanding ballots — especially those mailed-in — and a lot of reasons to feel good!"

The cliffhanger Senate race comes in what's otherwise shaping up to be another banner Arizona year for Republicans. The GOP has won every statewide race in Arizona over the past decade, and Democrats were hoping Sinema could break that streak.

Republican Gov. Doug Ducey was easily re-elected over a challenge from Democrat David Garcia, a professor. The GOP notched victories in the attorney general, treasurer and secretary of state races as well.

The picture was brighter for the state's Democrats in Congress, where Democrat Ann Kirkpatrick was elected to the Tucson-area swing district seat vacated by McSally and Democrats held all their other four seats, giving them a majority of the state's nine-member U.S. House delegation.

The Senate contest was the marquee race, featuring two champion fundraisers who are no strangers to tight races. They are battling over the seat vacated by Sen. Jeff Flake, a Republican who decided not to run for re-election because he realized his criticism of President Donald Trump made it impossible for him to survive politically.

McSally and Sinema have both remade themselves politically. McSally, 52, is a onetime Trump critic who has embraced the president since his election. She has tried to rally Republican voters by emphasizing her military background as the first U.S. female combat pilot while touting her support for the president's tax cut and other parts of his agenda.

Sinema, 42, is a former Green Party activist who became a Democratic centrist with her first election to the House of Representatives in 2012.