HARRISBURG, Pa. — Republican lawmakers in Pennsylvania asked the U.S. Supreme Court on Monday to put a hold on a ruling in the presidential battleground state that extends the deadline in November’s election to receive and count mailed-in ballots.

Republicans, including President Donald Trump’s campaign, have opposed such an extension, arguing that it violates federal law that sets Election Day as the first Tuesday in November and that such a decision constitutionally belongs to lawmakers, not the court.

Republicans also object to a portion of the state court’s ruling that orders counties to count ballots that arrive during the three-day extension period even if they lack a postmark or legible postmark, unless there is proof they were mailed after polls closed.

“This is an open invitation to voters to cast their ballots after Election Day, thereby injecting chaos and the potential for gamesmanship into what was an orderly and secure schedule of clear, bright-line deadlines,” lawyers for the Senate’s two top Republicans wrote.

The state Democratic Party and its allies had sought an extension of Pennsylvania’s Election Day deadline to count mailed ballots as their voters are requesting mail ballots at a nearly 3-to-1 ratio over Republicans.

In its Sept. 17 ruling, the divided state Supreme Court said ballots must be postmarked by the time polls close and be received by county election boards at 5 p.m. on Nov. 6, three days after the Nov. 3 election.

The court cited warnings about Postal Service delays in making huge numbers of ballots late and surging demand for mailed ballots during the coronavirus pandemic to invoke the power, used previously by the state’s courts, to extend election deadlines during a disaster emergency.

In another battleground state won narrowly by Trump in 2016, a federal appeals court on Sunday halted a lower court’s order to extend counting mailed-in ballots in Wisconsin by six days after election day.

The halt is a victory for Republicans and Trump over Democrats and their allies seeking more time as a way to help deal with an expected historic high number of absentee ballots.

The filing with the nation’s highest court comes as Pennsylvania counties, including Philadelphia and Allegheny, have begun sending out ballots to registered voters who asked to vote by mail.

It also comes less than two days after Trump, at a rally at Harrisburg International Airport, said the only way he can lose Pennsylvania is if Democrats cheat as part of his long-running effort to discredit voting by mail.

“They’re going to try to steal the election. ... The only they way to win Pennsylvania frankly is to cheat on the ballots,” Trump said Saturday at a rally attended by thousands.

In accusing Democrats of cheating, Trump also again seized on a matter that emerged last week in northeastern Pennsylvania where, according to a county official there, a temporary election worker mistakenly threw away nine mailed-in military ballots in the election office.

Seven were completed ballots cast for Trump, according to federal investigators. There were no accusations of election fraud from authorities investigating it, although Trump’s campaign quickly touted it as Democrats trying to steal the election.

It still wasn’t clear, however, how or why they ended up in the trash, and Gov. Tom Wolf, a Democrat, said Monday that his administration is still trying to find that out.

He also pointed that voting by mail has been going on in Pennsylvania for a long time — although a year-old law greatly expanded it — and he suggested that Trump is calling it fraudulent because he is losing.

“I certainly understand the idea of the side that appears to be losing would call foul on the process,” Wolf said. “But the commonwealth is doing everything we can do make sure the elections are fair and every ballot is counted, just as we did back in the primary with this new system.”

Associated Press writer Michael Rubinkam in northeastern Pennsylvania contributed to this report.