For months now, election officials have cautioned that the winner of the presidential election may still be unknown when election night is over.

Rules in some states don't allow election workers to begin the labor-intensive work of processing mail-in ballots until Election Day. And with a record number of voters casting their ballots by mail, the influx could delay final tallies for days.

In six particularly key states — Arizona, Florida, Michigan, North Carolina, Pennsylvania and Wisconsin — the margin of victory is expected to be slim, so it may be hard to know who won until their mail ballots are fully counted. It takes 270 electoral votes to secure the White House — these states account for 101 combined.

While election officials in the swing states of Michigan and Pennsylvania are telling voters it may take a few days before results are tallied in full, officials in Arizona, Florida and North Carolina, where mail ballots can be processed far in advance, are expecting to have results more quickly. But if the contest is close in those states, a final count could take a long time as absentee ballots sent close to Election Day trickle in.

Here's a closer look at what to expect:

Arizona

State law in Arizona allows election officials to count mail votes up to two weeks before Election Day, so most ballots received by this weekend will already be counted in advance. Those tallies can be released starting around 10 p.m. ET on election night, along with early vote results. Votes cast at polling places on Election Day will follow shortly afterward.

The pre-counted absentee ballots and in-person votes will make up the bulk of votes cast in Arizona, so it's possible a winner there could be declared on election night.

Absentee ballots sent right before the election, however, may not be tallied until Thursday or Friday, so if the race is close, it could remain undecided late into next week.

In Arizona, as well as elsewhere where mail votes can be counted ahead of Election Day, early tallies may show a lead for Joe Biden. But the results could begin to swing back toward President Trump when in-person votes are factored in later in the evening. For good measure, that could all shift again as the last remaining mail ballots trickle in.

Florida

Americans may know who won Florida before they go to bed on election night.

Unlike Pennsylvania, Michigan and Wisconsin, Florida allows counties to do processing work — like sorting and opening envelopes — weeks before Election Day. Also unlike other states, it doesn't allow a grace period for receiving mail ballots after Election Day.

All early votes and mail ballots tabulated in advance are supposed to be released starting around 7:30 p.m. ET on election night, according to Mark Ard, communications director at the Florida Department of State.

"If the election is decisive enough, we should be able to call Florida on Election Night," University of Florida political scientist Michael McDonald told the South Florida Sun-Sentinel.

Like Arizona, those early and mail ballot votes that are tallied in advance and released first are expected to be more favorable to Biden, balanced out shortly after as polls close and in-person votes are counted.

However, it may take some counties longer to finish counting mail ballots that arrive just before and right on Election Day. If the election is close, it may take until Wednesday or Thursday, when those counties finish counting, to determine who won the Sunshine State.

Michigan

"It could take until Friday, Nov. 6 for all ballots to be counted," the office of Michigan Secretary of State Jocelyn Benson wrote on Thursday. "Depending on how close the races are, this likely means that outcomes will not be determined on Tuesday."

In Michigan, election officials in cities with more than 25,000 residents can start processing mail ballots on Monday at 10 a.m., sorting ballots and removing outer envelopes. They can't be counted, though, until polls close.

Historically, the city of Detroit, an important Democratic stronghold, has been slow to tally election results. In a press conference on Thursday, Detroit City Clerk Janice Winfrey said the city has hired thousands of additional poll workers to improve the process, but warned that the final results won't be ready on Tuesday night and talked about the idea of "election week."

"Time is not a real concern of ours," Winfrey said. "We want to make sure that every voter and every ballot ... has been properly processed, received and tabulated on Election Day."

As in Pennsylvania and Wisconsin, Democrats in Michigan are expected to disproportionately cast their ballots by mail. If in-person tallies start to be released before mail ballots are totaled, it could show President Trump ahead at first, with his lead narrowing or disappearing as more mail ballots are counted.

North Carolina

North Carolina is another state where initial results should come quickly.

The North Carolina State Board of Elections estimates 80% of votes will be cast early or by mail and will be released once polls close at 7:30 p.m. ET.

"For the 20% or so of North Carolinians who vote on Election Day, we will be receiving those from the precinct and uploading those, as well," executive director of the North Carolina State Board of Elections Karen Brinson-Bell said on Thursday. "So, if there are really close races, those Election Day votes will tremendously matter in the outcomes of these elections."

Initial results may favor Democrats, who are more likely to vote by mail. An influx of Republican votes could pour in as Election Day votes are tallied.

North Carolina accepts mail ballots that arrive by Nov. 12 so long as they were postmarked by Election Day, a policy recently upheld by the U.S. Supreme Court. So as in other states with generous mail ballot deadlines, those final ballots could matter if races are tight and leave the final result unclear for days past Election Day.

Pennsylvania

Secretary of State Kathy Boockvar has said that the "overwhelming majority" of ballots will be tallied by Friday, Nov. 6.

"We're sure it will take more time than it used to," Gov. Tom Wolf said Thursday. "We probably won't know results on election night."

Pennsylvania election officials can accept mail ballots that arrive up to three days after the election, as long as they were postmarked by Nov. 3.

Many counties say they will begin processing ballots as soon as allowed, at 7 a.m. on Election Day, but a handful, like Cumberland County outside Harrisburg, say they won't begin dealing with absentee ballots until Wednesday.

"We're having a conversation with any county that says they're waiting," Boockvar said on Thursday. "I want every one of them starting on Election Day."

Erie County, which swung from Obama to Trump in 2016, will begin processing absentee ballots on Election Day, but will wait to count them until about 11 p.m., after in-person ballots are counted.

In Luzerne County, home to Wilkes-Barre, County Manager David Pedri told NPR the county is hoping to count a large portion of the mail ballots on Tuesday night, but won't finish until Wednesday or Thursday. He said he has 40 people working from 7 a.m. until 9 or 10 p.m. processing and later counting ballots. Keeping them on the clock much longer can result in mistakes being made, said Pedri.

During the primary, Pedri says it took four days to count 40,000 mail ballots. They've since added an envelope opening machine that should speed the process, but this fall, Luzerne has sent out 70,000 mail ballots — a third of the electorate.

In Bucks County, outside Philadelphia, Commissioner Robert Harvie told NPR that officials will begin announcing batches of results from in-person and mail voting at 10 p.m. on election night. He says it's hard to know how long it will take to finish because they don't know how many absentee ballots will be returned still, but he's confident they will be done "before Friday."

If the 2020 election comes down to Pennsylvania, and the margin is tight, it is possible the election hangs in the balance for several days.

Wisconsin

"I believe that we will be able to know the results of the Wisconsin election, hopefully that night and maybe at the latest the very next day," Gov. Tony Evers said earlier this month.

Wisconsin cannot begin the bulk of its processing work until Election Day, but most counties say they expect to finish counting before Wednesday morning.

Julietta Henry, the Milwaukee County elections director, said she expects the county will finish reporting absentee ballots between 3 a.m. and 6 a.m. on Wednesday.

"If it takes longer than that, we just ask that you be patient because we want to make sure every vote is counted and is counted accurately," she says. "We'll be here 'til it's done."

State law says the count cannot be paused once it begins, so election workers may end up working through the night, though the elections commission has expressed some leniency on that front.

"There are certainly smaller cities and towns where the results will come in like normal," said Reid Magney, public information officer for the Wisconsin Elections Commission. "But in some bigger cities, especially where they count absentee ballots at a central location instead of the polling place, we might not see all the results until the next morning."

Copyright 2020 NPR. To see more, visit https://www.npr.org.