In this May 15, 2020, file photo, demonstrators rally outside the Pennsylvania Capitol in Harrisburg to protest the closure of businesses due to the coronavirus pandemic.
CNN  — 

The office of Democratic Pennsylvania Gov. Tom Wolf said in a statement Monday that his administration plans to appeal a federal court ruling that declared some prohibitions on certain types of large gatherings unconstitutional.

The state government’s coronavirus shutdown measures “were mirrored by governors across the country and saved, and continue to save lives in the absence of federal action” said Lyndsay Kensinger, Wolf’s press secretary. Kensinger added that the decision is “especially worrying as Pennsylvania and the rest of the country are likely to face a challenging time with the possible resurgence of COVID-19 and the flu in the fall and winter.”

The ruling by Judge William Stickman IV of the Western District of Pennsylvania will lift restrictions on nonessential businesses that prevent gatherings above certain numbers of people. The state can still restrict some businesses from operating at full capacity with proportionate attendance limits, Stickman decided.

“The imposition of a cap on the number of people that may gather for political, social, cultural, educational and other expressive gatherings, while permitting a larger number for commercial gatherings limited only by a percentage of the occupancy capacity of the facility is not narrowly tailored and does not pass constitutional muster,” Stickman wrote.

President Donald Trump sent several retweets about the ruling. The President, who has attacked such shutdown orders as harmful, flouted similar restrictions on gatherings in Nevada on Sunday night.

Trump also retweeted a video of a group of seniors dancing and then removing their masks, with a caption reading, “PENNSYLVANIA GOVERNOR TOM WOLF AN YOUR STUPID WIFE …..YOUR NOT GOING TO MURDER US !!! TRUMP 2020 … WE LOVE PENNSYLVANIA.”

Wolf and state Health Secretary Dr. Rachel Levine had barred indoor gatherings of more than 25 people and outdoor events with more than 250 people to stop the spread of coronavirus.

But Stickman decided that order and other restrictions violated the First Amendment and other constitutional rights of the state’s citizens. He said some of the state government’s restrictions were “draconian” and had no real end in sight.

The judge also ruled against Pennsylvania’s stay-at-home orders, many of which had already been lifted.

“Good intentions toward a laudable end are not alone enough to uphold governmental action against a constitutional challenge,” Stickman wrote in the opinion Monday. “Indeed, the greatest threats to our system of constitutional liberties may arise when the ends are laudable and the intent is good – especially in a time of emergency.”

Candidates in the state had sought in the lawsuit to hold political rallies.

Kensinger said in a statement Monday that the ruling is “limited to the business closure order and the stay at home orders issued in March and were later suspended, as well as the indoor and outdoor gathering limitations” and does not impact any of the other coronavirus mitigation orders that are in place.

While she did not comment specifically on the ruling during a news conference Monday afternoon, Levine said that “anything that limits our ability and the number of tools we have is a challenge to public health.” She encouraged Pennsylvanians to continue to practice coronavirus mitigation efforts, despite the court ruling.

Wolf’s administration will seek a stay of Stickman’s ruling while it files an appeal. It’s unclear what the immediate impact of the judge’s decision will be, CNN legal analyst Steve Vladeck said, given how Pennsylvania’s coronavirus orders have evolved in recent months.

CNN has reached out to Pennsylvania Attorney General Josh Shapiro and to Wolf’s office for additional comment.

CNN’s Nikki Carvajal contributed to this report.