The Supreme Court on Monday night allowed Pennsylvania election officials to count mail-in ballots received up to three days after Election Day, refusing a Republican request to stop a pandemic-related procedure approved by the state’s highest court.

The justices’ action involved an arcane voting practice but carried outsize importance because of Pennsylvania’s pivotal role in the presidential election. It prompted a fierce battle between the state’s Democrats and Republicans.

It also showed a precariously balanced Supreme Court, which has only eight members after the death last month of Justice Ruth Bader Ginsburg, and the potential importance of President Trump’s nominee to replace her, Judge Amy Coney Barrett.

The court was tied on the Republican request, which means the effort failed.

The court’s four most conservative justices — Clarence Thomas, Samuel A. Alito Jr., Neil M. Gorsuch and Brett M. Kavanaugh — said they would have granted the stay.

But that takes five votes, which means Chief Justice John G. Roberts Jr. sided with liberal Justices Stephen G. Breyer, Sonia Sotomayor and Elena Kagan.

Neither side explained its reasoning, which often is the case with emergency requests. But the outcome underscored the decisive role Barrett could play if she is confirmed by the Republican-controlled Senate — with a vote there expected as soon as next week. Trump has said he wants his nominee on the court in case it is split on litigation arising from the election.

That, in turn, has prompted calls from Democrats that Barrett pledge to recuse herself from election cases. She declined to say at her confirmation hearings last week what she would do so if faced with such a decision.

The Supreme Court had considered the Republican request for nearly two weeks, indicating that an attempt at compromise might have failed.

Monday’s order was the latest in a string of election procedure battles waged in the states between Democrats and Republicans.

Previously, the court sided with South Carolina Republicans and said most mail-in ballots there must contain a witness’s signature, something federal courts had said should be waived because of the coronavirus pandemic.

The litigation is often over seemingly small details — but ones that could make a difference in close races.

Pennsylvania has particular significance because it is crucial to Trump’s reelection fortunes. He defeated Hillary Clinton there in 2016 by 44,000 votes, or less than one percentage point.

The Pennsylvania Supreme Court ruled in Democrats’ favor last month on a number of mail-voting rules: permitting voters to turn in ballots via dropbox in addition to using the U.S. Postal Service; allowing ballots to be returned up to three days after Election Day; and blocking a Republican effort to allow partisan poll watchers to be stationed in counties where they do not live.

Pennsylvania’s Republican legislators and the state GOP asked the U.S. Supreme Court to weigh in only on the ruling pushing back the deadline for mail ballots to arrive. The state court said such ballots must be counted if they are postmarked by Nov. 3 — and even if no postmark is discernible, “unless a preponderance of the evidence” shows that the ballots were mailed after Election Day.

“In a year where there is a very real possibility that the final presidential election result hinges on Pennsylvania, the new rules imposed by the decision of the Supreme Court of Pennsylvania (a body elected in partisan elections) could destroy the American public’s confidence in the electoral system as a whole,” said the stay request filed by the Republican leaders.

The state Supreme Court decision was based on a clause in the commonwealth’s constitution mandating that “all aspects of the electoral process in Pennsylvania be open and unrestricted so as not to disenfranchise Pennsylvania voters,” the state’s Democratic attorney general, Josh Shapiro, said in defending the state court decision.

“The Pennsylvania Supreme Court’s decision protected that right and brought much needed clarity to the exigent circumstances surrounding a global pandemic,” Shapiro wrote. “In doing so, that court ensured that Pennsylvanians would not be forced to choose between exercising their right to vote and protecting their health.”

He rejected Republicans’ claim that the decision essentially extended voting beyond Election Day and said it was a key aspect of federalism that states decide how to run their elections.

Pennsylvania lawmakers said the decision takes away the power of legislatures to set election rules. The changes are tied to challenges of the pandemic, they said, but “the Supreme Court of Pennsylvania’s own special master found that COVID-19 is not likely to disrupt the November General Election ballot receipt deadline.”

While the U.S. Supreme Court is often skeptical of federal judges changing rules during an election, it would have been rare for the court to intervene when a state court was interpreting the state’s constitution and laws. That makes the tie vote surprising, considering it was the court’s conservatives who were ready to stop the state court.

A coalition of Republican lawyers and officials from previous administrations had warned the court in an amicus brief that would be a mistake.

They said that a denial of the stay request “by the broadest majority possible will benefit this court, our country, and its precious tradition of the peaceful retention or transfer of power.” Former Pennsylvania governor Tom Ridge (R) was among those who signed the brief.

The cases are Scarnati v. Boockvar and Republican Party v. Boockvar.