The margins between Democrats and Republicans narrowed significantly Wednesday in key Arizona races as election officials stopped counting more than half a million mail-in ballots returned on and before Election Day. Democrats maintained small but shrinking leads in key races for the US Senate, governor and secretary of state, while Republicans were optimistic late votes would swing heavily in their favor, as they did in 2020. It may take several days to see who won some of the closest contests. With Republicans still in the hunt, it remained unclear whether the stronger-than-expected showing for Democrats would extend to Arizona, a longtime Republican stronghold that has become a battleground during Donald Trump’s presidency. The GOP named a slate of candidates who won Trump’s endorsement after falsely claiming his loss to President Joe Biden was tainted. Among them is former television news anchor Carrie Lake, who was about half a point behind Democratic Secretary of State Katie Hobbs in the governor’s race, a contest that has focused heavily on Lake’s unsubstantiated allegations of fraud in the 2020 election. The Republican nominee for attorney general was also marginally behind. Lake predicted she would “win big” and urged her Twitter followers to “stay tuned.” Democrats had more comfortable 5-point margins in the US Senate and Secretary of State races, but with so many ballots pending, the races were too early to call. In the attorney general race, Republican Abraham Hamadeh took the lead from Democrat Kris Mayes. Officials in Maricopa County, the most populous state, said about 17,000 ballots were affected by a printing mishap that prevented vote counters from reading some ballots, a problem that slowed voting in some locations and angered Republicans who were counting on a strong turnout on Election Day. elections. County officials said all ballots will be counted, but did not provide a timeline for that. They offered no new information about what caused the problem, but promised a thorough investigation. “There is no such thing as a perfect election. Yesterday was not a perfect election,” said Bill Gates, the Republican chairman of the county board of supervisors. “We’re going to learn from it and get better.” An urban-rural political divide was evident among Arizona voters. Democrats Katie Hobbs and Sen. Mark Kelly each garnered support from nearly two-thirds of urban voters, according to AP VoteCast, an extensive survey of more than 3,200 Arizona voters. Suburban voters were about evenly split between the two Democratic candidates and their GOP rivals, Kari Lake and Blake Masters. Small-town and rural voters were more likely to favor Lake and Masters. In the Senate race, suburban men and women were split on candidate preferences. Suburban men clearly favored the Masters, suburban women Kelly. In the gubernatorial race, suburban men overwhelmingly supported Lake, while suburban women slightly favored Hobbs. Meanwhile, Republicans who control the three-member board of supervisors in southeastern Arizona’s Cochise County voted Wednesday to appeal a judge’s ruling that prevented them from hand-counting all ballots, which are also recorded by machines. Efforts to count ballots by hand in the county and elsewhere across the nation are being driven by unfounded concerns from some Republicans that problems with vote-counting machines or voter fraud led to Trump’s 2020 defeat. A judge said the plan ran afoul of state election law that limits hand counting to a small sample of ballots, a process meant to confirm that the machine count was accurate. —— Associated Press writers Bob Christie and Terry Tang contributed.