A statewide court on Friday declared that Pennsylvania’s expansive two-year-old mail-in voting law is unconstitutional, agreeing with challenges by Republicans.

The decision, by a five-judge Commonwealth Court panel of three Republicans and two Democrats, would be put on hold immediately if Gov. Tom Wolf’s administration files an appeal to the state Supreme Court as promised.

“The Administration will immediately appeal this decision to the state Supreme Court and today’s lower court ruling will have no immediate effect on mail-in voting pending a final decision on the appeal,” Wolf’s office said in a statement.

Still, the decision throws Pennsylvania’s voting laws into doubt as the presidential battleground state’s voters prepare to elect a new governor and a new U.S. senator in 2022.

Just over 2.5 million people voted under the law’s expansion of mail-in voting in 2020′s presidential election, most of them Democrats, out of 6.9 million total cast.

Former President Donald Trump, who attributes his 2020 loss to Joe Biden to voter fraud that he blames in part of mail-in voting, quickly lauded the decision.

“Big news out of Pennsylvania, great patriotic spirit is developing at a level that nobody thought possible. Make America Great Again!” he said in a statement through his political action committee.

The three Republican judges agreed with Republican challengers — including 11 Republican lawmakers who actually voted for the law — and ruled that no-excuse mail-in voting is prohibited under the state constitution, until the constitution is changed to allow it.

The two Democrats on the panel dissented. The state Supreme Court — where an appeal was expected shortly — has a 5-2 Democratic majority.

Pennsylvania’s attorney general, Josh Shapiro, said in a statement the opinion will be immediately appealed and will not have any immediate impact on Pennsylvania’s upcoming elections.

Shapiro, a Democrat who is running for governor, said he is confident the state Supreme Court will uphold the mail-in voting law as constitutional, and criticized the lower court’s opinion as “based on twisted logic and faulty reasoning, and is wrong on the law.”

In 2019, the Republican-controlled Legislature authorized no-excuse mail-in voting for all voters, expanding upon a provision in the state constitution that required the state to provide the option for people to vote if they are unable to vote in person for specific reasons.

Those reasons include being out of town on business, illness, physical disability, election day duties or a religious observance.

Every Republican lawmaker except one voted for the bill in a deal with Wolf, who had sought the mail-in voting provision. In exchange, Wolf agreed to get rid of the straight-ticket voting option that Republicans had sought as a way to protect their suburban candidates from an anti-Trump wave in 2020’s election.

The Constitution does not explicitly say that the Legislature cannot extend absentee voting to others.

However, Republican challengers say the constitution intended that absentee voting be strictly limited, citing a passage that says voters must live in an election district for at least 60 days where they “shall offer to vote.”

In the opinion, the three Republican judges agreed, saying that passage had been cited in two prior state Supreme Court decisions to invalidate laws passed in 1839 and 1923 to expand absentee voting.

The dissenting Democrats on the panel say a separate provision of the constitution empowered lawmakers to provide no-excuse mail-in voting by law. That provision says “All elections by the citizens shall be by ballot or by such other method as may be prescribed by law.”