Pennsylvania’s Attorney General Josh Shapiro, a Democrat, found himself in hot water on social media after claiming that President Trump has lost the ability to win the battleground state, just over 24 hours before the polls close on Election Day.

“If all the votes are added up in PA, Trump is going to lose,” Shapiro wrote on Twitter. “That’s why he’s working overtime to subtract as many votes as possible from this process.”

“For the record, he’s 0-6 against us in court,” the attorney general added. “We’ve protected voting rights. Now, ignore the noise—vote!”

THE CLOSING STRATEGY: A LOOK AT BIDEN AND TRUMP'S DAY OF CAMPAIGNING BEFORE THE ELECTION

Polling figures coming out of Pennsylvania, a battleground state with 20 electoral votes, are showing Democratic nominee Joe Biden with a narrow 2.9 percent lead over Trump -- but the polling is well within the four point margin of error.

Trump won Pennsylvania by a slim margin of .7 percent in 2016, despite the polls having showed Hillary Clinton with a larger lead than Biden one day before the general election.

FiveThirtyEight showed Clinton with a 3.8 percent advantage over Trump in the Keystone State the day before the last presidential election.

Angered social media users were quick to jump on Shapiro’s comments, pointing to what they viewed as hypocrisy in the system coming from a leading legal figure in Pennsylvania.

“[S]uffice to say if a Republican Attorney General of a swing state took the position that it was impossible for Joe Biden to win a legitimate election in their state, the Democratic freakout would be *massive*,” Logan Dobson, a Republican pollster, said on Twitter.

PENNSYLVANIA AG DISMISSES TRUMP, SAYS HE COULD 'CARE LESS' WHAT PRESIDENT SAYS ON ELECTION NIGHT

“[I]t seems highly unethical for the top law enforcement officer in one of the most important states to call the election before Election Day,” Conservative CNN contributor, Scott Jennings, tweeted. “This guy is the AG!”

The attorney general’s tweet followed Trump’s comments on the campaign trail in Pennsylvania over the weekend, where he again attempted to disseminate doubt in the minds of voters over the validity of mail-in voting and the likelihood of fraud in the upcoming election.

“You wait and very bad things can happen with ballots,” he told a crowd in Butler, Pa.

Several states have extended the ballot deadline to assist voters in returning their ballots, in order to allow for mail delays caused by the pandemic – including Pennsylvania, which has granted a three day extension. Despite Trump's comments, there is no evidence of widespread voter fraud resulting from mail-in ballots.

CLICK HERE TO GET THE FOX NEWS APP

Various other swing states have granted similar extensions including Georgia, Iowa, Michigan, Nevada, North Carolina, Ohio and Wisconsin.