The Pennsylvania Supreme Court ruled Friday that mail-in ballots without the correct dates on envelopes cannot be counted in elections, a decision which could prove crucial in this year’s presidential election where 19 electoral college votes are up for grabs.

The state’s high court ruled on procedural grounds, saying a lower court that found the mandate unenforceable should not have taken up the case because it did not draw in the election boards in all 67 counties. Left-leaning groups that filed the case only sued two of them, Philadelphia and Allegheny counties.

The Pennsylvania Supreme Court said the lower Commonwealth Court "lacked subject matter jurisdiction to review the matter," according to a court filing.

TRUMP CRUSHING HARRIS IN PENNSYLVANIA BAKERY'S ELECTION 'COOKIE POLL': 'PEOPLE ARE UPSET'

Pennsylvania ballots

An election worker flattens ballots during the 2024 Pennsylvania primary election at the City of Philadelphia's Election Warehouse in Philadelphia, Pennsylvania on April 23, 2024. The Pennsylvania Supreme court ruled Friday that mail-in ballots without the correct dates on envelopes cannot be counted in elections, a decision which could prove crucial in this year’s presidential election. (Hannah Beier/Bloomberg via Getty Images)

Commonwealth Court two weeks ago halted enforcement of the handwritten dates on exterior envelopes. Friday's ruling now means mail-in ballots must be properly dated in order to be counted enforceable. 

The ruling was welcomed by Republicans as a victory for voter integrity in the hotly contested state, while voting rights advocates including the American Civil Liberties Union said they will look at pursuing additional legal options.

President Joe Biden won the state by more than 80,000 votes in 2020, and former President Trump and Vice-President Harris have been campaigning in the Keystone State this week.

Over 800,000 people requested mail ballots for April's primary election where officials disqualified nearly 16,000 mail-in ballots for irregularities. Almost half were disqualified because of issues such as missing signatures and wrong dates on outer envelopes, according to the New York Times. About 75% of the mail-in ballots requested were made by Democrats. 

Around 2.5 million Pennsylvanians voted by mail in 2020, according to a lawsuit filed by Republicans in the aftermath of the election which sought to declare universal mail-in voting unconstitutional.

HARRIS, TRUMP ENTER POST-DEBATE 'HOMESTRETCH' WITH DUELING RALLIES IN KEY BATTLEGROUND STATES

Kamala Harris and Donald Trump

Former President Trump and Vice-President Harris have been campaigning heavily in the Keystone State. (Left: (Photo by SAUL LOEB/AFP via Getty Images), Right: Hannah Beier/Bloomberg via Getty Images)

RNC Chairman Michael Whatley said the Friday ruling was a "huge" win for election integrity.

"Following legal action from the RNC and @PAGOP [Republican Party of Pennsylvania], the PA Supreme Court REJECTED a Democrat attempt to count undated ballots," Whatley wrote. "This makes mail voting in the Keystone State less susceptible to fraud. We will keep fighting and winning!"

Steve Loney, the senior supervising attorney for the ACLU in Pennsylvania, said the ruling was a setback for Pennsylvania voters.

"These eligible voters who got their ballots in on time should have their votes counted and voices heard," Loney said. "The fundamental right to vote is among the most precious rights we enjoy as Pennsylvanians, and it should take more than a trivial paperwork error to take it away."

The justices ruled 4-3, with two Democrats joining both Republicans on the Supreme Court to vacate the Commonwealth Court decision.

CLICK HERE TO GET THE FOX NEWS APP

GOP chair vows 'we absolutely have the resources' to win in November

RNC Chairman Michael Whatley said the Friday ruling was a "huge" win for election integrity. (Fox News - Paul  Steinhauser)

The dissent by three other Democratic justices said the high court should have taken up the dispute.

"A prompt and definitive ruling on the constitutional question presented in this appeal is of paramount public importance inasmuch as it will affect the counting of ballots in the upcoming general election," wrote Justice David Wecht. He and the two other dissenters would have ruled on the matter based on written briefs.

Prior to the 2020 election, Republicans sought to prevent mail-in ballots received after election day from being counted, but ultimately, the Supreme Court sided with the Pennsylvania Supreme court decision allowing ballots to be counted if they were received within three days of election day, even if they did not have a legible postmark.

The Associated Press and Reuters contributed to this report.