ATLANTA (AP) — Election officials in several key states furiously counted ballots Wednesday as the nation awaited the outcome of the race between President Donald Trump and Democrat Joe Biden and braced for possible recounts and legal challenges.

Unlike in previous years, states were contending with an avalanche of mail ballots driven by the global pandemic. Every election, what’s reported on election night are unofficial results, and the counting of votes extends past Election Day. This year, with so many mail ballots and close races in key states, counting every vote was expected to take more time.

Here’s what was happening Wednesday in six key states:

GEORGIA

Georgia Secretary of State Brad Raffensperger said he was pushing counties to complete vote tallies, with just under 100,000 ballots left to count as of Wednesday night.

There was a narrow margin between Trump and Biden in Georgia, a close race in a state that has not backed a Democrat for president since 1992. There is no automatic recount, but a candidate can request one if the margin is within 0.5%.

“We have long anticipated – and said publicly – that counting would most likely take place into Wednesday night and perhaps Thursday morning,” Raffensperger said in a statement issued earlier in the day. “We’re on pace to accomplish that responsibly, ensuring that the voice of every eligible voter is heard. It’s important to act quickly, but it’s more important to get it right.”

The outstanding vote was primarily in the Atlanta area, which tends to lean Democratic. On Wednesday, about 50 people were counting votes inside State Farm Arena, the home of the Atlanta Hawks NBA team. Counties have until 5 p.m. on Nov. 13 to certify results.

At stake in Georgia are 16 electoral votes. All absentee ballots were due Tuesday.

MICHIGAN

The Associated Press called Michigan for Biden on Wednesday, as the Trump campaign filed legal challenges there and in other battleground states.

Secretary of State Jocelyn Benson had urged patience as counties tallied thousand of ballots that had been received on Election Day. Many of those were from Democratic cities such as Detroit, Grand Rapids, Flint and Kalamazoo.

“These ballots were cast by tens of thousands of Michigan citizens who have the right to have their vote counted. We’re going to make sure that right is protected,” Benson said.

In its lawsuit, the Trump campaign demanded better access for observers at locations where ballots were being processed and counted. Campaign manager Bill Stepien said its observers had not been provided with “meaningful access” to monitor the opening of ballots and the counting process in numerous locations.

At one location, however, The Associated Press observed poll watchers from both sides monitoring on Wednesday.

Michigan has 16 electoral votes.

NEVADA

The top elections official in Nevada’s most populous county said more results will be released Thursday morning that include mail-in ballots received Tuesday and Wednesday.

Clark County Registrar of Voters Joe Gloria said at a news conference Wednesday afternoon that he did not yet have a number of how many ballots had been received but uncounted in the Las Vegas-area.

Unofficial results showed Biden with a slim lead over Trump, but it was too early to declare a winner in the race Wednesday with a large number of ballots yet to be counted. Ballots would continue to be accepted if they were postmarked by Election Day.

The number of outstanding mail ballots is difficult to estimate because Nevada opted to send ballots to all 1.7 million active registered voters this year due to the pandemic, and it’s hard to predict how many will choose to return them.

At stake in Nevada are 6 electoral votes. All mail ballots are due Nov. 10 if postmarked by Election Day.

NORTH CAROLINA

Elections officials were working through the remaining ballots and would continue to process and count those delivered by the Postal Service through Nov. 12, as long as they were postmarked by Election Day.

Though Trump is correct that he held a nearly 77,000-vote lead in the state early Wednesday, the race is too early to call with up to 116,000 mail ballots left to count, as well as the potential of thousands of provisional ballots.

The state board had extended the deadline for absentee ballots to be received at local election offices from Nov. 6 to Nov. 12 as part of a consent decree in a state lawsuit by voting rights advocates. They must be postmarked by Election Day. Counties have until Nov. 13 to finish counting.

“Regardless of vote differential, we never stop counting until all eligible votes are counted and added to the final certified and audited results,” said Karen Brinson Bell, executive director of the state elections board.

At stake in North Carolina are 15 electoral votes.

PENNSYLVANIA

An estimated 1 million ballots have yet to be counted in Pennsylvania, and the Trump campaign indicated it would be taking legal action to temporary halt vote tallying.

State election officials had warned repeatedly in the lead up to Election Day that it would take days to count because of a massive surge in absentee ballots brought on by the pandemic and a recent change in state law that meant an excuse was no longer needed to vote absentee. Slowing the process down was the fact that local election officials could not begin processing and scanning ballots ahead of Election Day, as most states did.

On Wednesday, Philadelphia aired live video of workers in yellow and orange safety vests preparing ballots to be scanned. City officials counseled patience.

“Counting votes cast by mail, if you’re going to do it right and you’re going to do it accurately — because there’s no other choice — takes a little bit of time,” City Commissioner Al Schmidt said. “It’s more important that we do it right than meet artificial deadlines.”

A lingering question is what will happen to mail ballots that arrive after Election Day. State law allows for these ballots to be counted so long as they are received by Nov. 7. Trump’s campaign said it would intervene in a case at the Supreme Court that deals with whether Pennsylvania ballots received up to three days after the election can be counted.

At stake in Pennsylvania are 20 electoral votes. All absentee and mail ballots are due Nov. 6 if mailed by Election Day.

WISCONSIN

The Associated Press called Wisconsin for Biden on Wednesday afternoon, and Trump’s campaign promised to seek an immediate recount citing “reports of irregularities in several counties.”

All ballots had been counted with the exception of 300 votes outstanding from one township and an unknown number of uncounted provisional ballots, likely fewer than 1,000 based on prior elections.

Biden’s lead was roughly 20,000 votes, or about six-tenths of a percentage point, and within the state’s 1-point margin for recounts.

Meagan Wolfe, the state’s top elections official, did not directly address the Trump campaign’s claim of irregularities. Instead, Wolfe defended the state’s voting processes, noting a recount of the 2016 presidential result showed no widespread problems and resulted in only a few hundred votes changing.

“There are no dark corners or locked doors on elections,” Wolfe said. “Anybody was free to watch those processes yesterday.”

At stake in Wisconsin are 10 electoral votes. All absentee ballots were due Tuesday.