President Trump's lead over Joe Biden in Pennsylvania was shrinking Thursday, as state election workers continued to count mail-in ballots.

As of Thursday afternoon, Trump was leading by more than 102,000 votes, with 50.2% of the vote so far, compared to Biden’s 48.6%. That lead was down from more than 164,000 votes earlier in the day Thursday, 326,000 on Wednesday afternoon and more than 600,000 early Wednesday.

The vote counted amid a legal fight over poll watchers overseeing the counting process in Philadelphia.

CLICK HERE TO SEE FOX NEWS’ LIVE PROBABILITY DIALS

An appellate court judge on Thursday cleared the way for the Trump campaign to more closely observe the canvassing of ballots by the Philadelphia County Board of Elections. Poll watchers were initially required to remain at least 25 feet away from tables where people were carrying on the task of scanning mail and absentee ballots inside the Pennsylvania Convention Center.

Pennsylvania Commonwealth Court Judge Christine Fizzano Cannon issued an order requiring “all candidates, watchers, or candidate representatives be permitted to be present for the canvassing process” and “be permitted to observe all aspects of the canvassing process within 6 feet, while adhering to all COVID-19 protocols, including, wearing masks and maintaining social distancing.”

The order was to go into effect immediately, or no later than 10:30 a.m. on Nov. 5.

But Trump campaign senior adviser Corey Lewandowski tweeted a video around 1:30 p.m. appearing to show a city attorney still preventing former Florida Attorney General Pam Bondi, and other poll watchers, from coming within 6 feet from election workers. 

Michelle Hangley, an attorney representing the city, who is also a former Democratic candidate for judge, repeatedly tells the Trump campaign that they're "evaluating the order.” But Bondi argues that no further evaluation is needed given the order simply states they can come within six feet of those counting the ballots to observe the process. 

JUDGE RULES FOR TRUMP CAMPAIGN, GRANTING REP BETTER VIEW OF PHILADELPHIA VOTE COUNT

Bondi also tweeted that staff at the convention center had “moved the fence up but moved the ballot machines back!!” She said: “This is offensive for the great people of Pennsylvania who voted and deserve a fair election.”

The city of Philadelphia and the Pennsylvania Democratic Party appealed the ruling to the Pennsylvania Supreme Court, whose justice will decide whether to grant or deny the appeal.

“Big legal win in Pennsylvania!” Trump tweeted, shortly after the decision was announced.

Two days after Election Day, neither candidate had amassed the votes needed to win the White House. But Biden’s victories in the Great Lakes states left him at 264, according to the Fox News Decision Desk, meaning he was one battleground state away from becoming president-elect.

Former Florida Attorney General Pam Bondi displays a court order granting President Donald Trump's campaign more access to vote counting operations at the Pennsylvania Convention Center, Thursday, Nov. 5, 2020, in Philadelphia, following Tuesday's election. At left is Trump campaign advisor Corey Lewandowski. (AP Photo/Matt Slocum)

Trump, with 214 electoral votes, faced a much higher hurdle. To reach 270, he needed to claim all four remaining battlegrounds: Pennsylvania, North Carolina, Georgia and Nevada. Trump generally was projected to receive a larger in-person voter turnout on Election Day, while Biden was thought to see a larger turnaround through vote by mail. 

Meanwhile, the remaining some 35,000 mail-in ballots yet to be counted in Alleghany County, which includes Pittsburgh, Pa., will not be tabulated until at least Friday. Election workers had counted some 313,072 out of the 348,485 mail-in or absentee ballots returned by 8 p.m. Tuesday, according to a county press release.

CLICK HERE TO INTERACT WITH FOX NEWS VOTER ANALYSIS

Out of the remaining some 35,413 left uncounted, about 29,000 were those belonging to voters who received incorrect ballots and were then issued corrected ballots. There were about 2,250 ballots that were unscannable and will need to be duplicated during the Return Board process, and about 4,350 miscellaneous ballots like ones missing the date, or an illegible voter declaration.

CLICK HERE TO GET THE FOX NEWS APP

No canvassing work was to be done Thursday at the Elections Warehouse, which was to remain closed to media and observers as elections staff carried out administration work. County Executive Rich Fitzgerald said the Return Board will convene on Friday, Nov. 6, at 9 a.m. in the Elections Warehouse despite originally planning for the County Office Building.

The Associated Press contributed to this report.