CNN  — 

Early vote totals on Tuesday night in Pennsylvania, Michigan and Wisconsin appeared to give President Donald Trump a comfortable edge over former Vice President Joe Biden.

But those numbers were never complete, and those tallies were changing overnight and into Wednesday as mail-in ballots from heavily Democratic areas in those states were counted.

A big reason for the delay: Laws in each state barred election officials from getting a head start on processing and counting the record number of mail-in ballots voters used amid the Covid-19 pandemic.

Take Pennsylvania. The Republican-controlled legislature refused to change state law to allow county election officials to start processing mail-in ballots until 7 a.m. on Election Day. That left local election officials with mountains of absentee ballots to process and count on top of the in-person vote cast on Tuesday.

Overall, Pennsylvania received nearly 2.6 million mail-in ballots, according to the state’s election website. Officials say that’s 10 times the number of absentee ballots it receives in a normal election. In the Democratic stronghold of Philadelphia alone, officials received more than 350,000 absentee ballots that they could not start processing until polls opened Tuesday.

Further delaying results in the Keystone State: Nine Pennsylvania counties, according to CNN’s reporting, opted to not start processing and counting ballots until Wednesday morning.

Secretary of State Kathy Boockvar on Wednesday tried to publicly nudge lagging counties to speed up reporting totals after a number of them appeared to have counted 0% of mail-in ballots on the state’s website. “We’re going to be following up with all those counties to say, ‘Hey, make sure you get us the files,’ ” she told reporters.

Biden’s campaign encouraged Democrats to vote early – while in-person votes likely favored Trump – so it’s no surprise that the former vice president’s vote tally would grow as officials count more mail-in votes.

The shifting count angered the President.”They are finding Biden votes all over the place – in Pennsylvania, Wisconsin, and Michigan,” he tweeted Wednesday “So bad for our Country!”

But Richard Hasen, an expert on election law at the University of California Law School at Irvine and a CNN analyst, said “there is nothing sinister going on.”

“In those three states, election officials begged for extra time” to process ballots and largely were thwarted by state legislators, he said.

“Ballots aren’t processed randomly, so you get swings in outcomes” once election officials add absentee ballots to the count, Hasen said.

Michigan, which received more than 3.1 million absentee ballots, faced similar restrictions in the run-up to Election Day.

A new state law gave cities with at least 25,000 residents a little more time than usual to process, but not count, mail-in ballots – an extra 10 hours on November 2, the day before the election. (Processing includes removing ballots from their outer envelopes and preparing them for tabulation.)

The short window to process mail-in ballots in states such Pennsylvania and Michigan stands in sharp contrast to Florida, where officials began processing ballots weeks before Election Day, allowing them to swiftly report results.

That’s a part of the reason Trump was quickly projected as the winner in Florida.

In Wisconsin, election workers had to wait until 7 a.m. Tuesday to begin most processing on nearly 2 million absentee and early vote ballots.

A surge in Wisconsin results overnight that largely favored Biden raised conservative ire, but it reflected the Democratic stronghold of Milwaukee reporting more than 169,000 absentee votes.

A separate battle between the political parties could play out in the weeks ahead over another batch of ballots: Mail-in votes that arrive after Election Day. Trump has railed against a Supreme Court decision that allows Pennsylvania to count ballots that arrive up to three days after the election.

But on Wednesday, election officials were scrambling to count the ballots they already had in hand.

Pennsylvania Gov. Tom Wolf, a Democrat, told reporters Wednesday morning the system is working as it should, even if full results weren’t available by day’s end.

“We have to be patient but confident that these votes are going to be counted, they’re going to be counted accurately and they will be counted fully,” he said. “The delay that we’re seeing is a sign that the system is working.”

CNN’s Kelly Mena, Ellie Kaufman, Konstantin Toropin and Casey Tolan contributed to this story.