PHOENIX — New vote totals late Friday showed Democrats building their leads in two close Arizona races, plus a Democrat edging ahead for the first time in a third race. But final tallies may take a week.

Democrat Sandra Kennedy led Republican Rodney Glassman for a seat on the all-GOP Arizona Corporation Commission.

With a strong showing in Maricopa County, Kennedy had 899,610 votes. That edged out Glassman by 1,672 ballots.

In fact, she was within 1,821 votes of incumbent Republican Justin Olson, who is seeking to hang on to the seat he was appointed to last year. There are two posts to be filled on the five-member commission.

The strong showing for Kennedy as counties continue to count ballots is mirrored in several other hotly contested races.

Democrat Kyrsten Sinema had opened up a lead of more than 20,200 votes over Republican Martha McSally, out of more than 2 million ballots already counted, as the pair compete to replace retiring U.S. Sen. Jeff Flake.

Democrat Kathy Hoffman’s bid to become the next superintendent of public instruction got a boost with the new returns, with her edge over Republican Frank Riggs approaching 32,000 votes.

The new tallies came on the heels of a settlement of a lawsuit filed by Republicans that questioned how some late-filed early ballots were still being counted in some counties — counties that have produced more Democratic votes — but not in others.

Friday’s deal requires all counties to allow for the same kind of counting, a process that could produce additional Republican votes. But there may not be enough in those 11 largely rural counties to make a difference.

The latest figures from the Secretary of State’s Office estimated there were about 362,000 ballots still to be processed. That includes about 266,000 in Maricopa County and 60,000 in Pima County.

The ballot counting in Pima County may not be finished until next Friday, elections director Brad Nelson said.

Elections workers will be working through the weekend, preparing batches of ballots for counting one day, then counting them the next. That means the approximately 40,000 early ballots remaining to be counted will be processed Saturday and again on Monday, Nelson said.

The early ballots left to be counted are mostly those turned in at polling places on Election Day, as opposed to being mailed in earlier.

There are also about 18,000 provisional ballots to be counted that should be completed by Friday, Nelson said. Another 2,000-3,000 ballots need to be duplicated to be processed. These are mainly ballots that are marked in such a way that the scanners can’t read them.

The Pima County Recorder began calling the owners of those provisional ballots Friday morning, to verify their signatures and other information. The call could decide whether the vote will be counted.

Those who receive a message have until Wednesday, Nov. 14, at 5 p.m. to discuss the matter with Pima County’s “problem ballot team.” To reach the group, voters can call 724-4330. Phone lines are open from 8 a.m. to 5 p.m. daily through Nov. 14.

See if your ballot was turned over to the Elections Department for tabulation at tucne.ws/votecount.

Republican and Democratic poll monitors are present at both the Pima County Recorder’s office, where ballots are verified, and the elections department.

The processing of ballots in Pima and Maricopa counties has become the topic of intense focus because of the close race for U.S. Senate.

President Trump weighed in via Twitter, claiming without evidence there was irregularity in the vote-counting.

The Arizona Daily Star contributed to this report.