HARRISBURG, Pa. — Pennsylvania’s highest court on Wednesday struck down a requirement that has forced casinos to pay tens of millions of dollars to their host communities for a decade, potentially dealing a crippling blow to local budgets around the state if lawmakers do not act quickly.

The Pennsylvania Supreme Court ruled that the roughly 4 percent “local share assessment” is unconstitutional because it is not uniform and affects Pennsylvania’s 12 casinos differently.

The justices said they would delay the effect of their decision striking down the tax for four months to give lawmakers an opportunity to fix it.

“We are mindful that our decision may significantly affect many counties and municipalities that have ordered their affairs in reliance upon” the casino tax revenue, Justice David Wecht wrote in the 18-page opinion.

Under the state’s original 2004 casino law, casinos must pay at least 4 percent of gross slot-machine gambling revenues to their host communities. That includes 2 percent to counties and 2 percent or $10 million, whichever is greater, to municipalities.

SugarHouse Casino in Philadelphia is exempt, as are two smaller “resort” casinos: Valley Forge Casino in suburban Philadelphia and Lady Luck Casino Nemacolin in southwestern Pennsylvania.

But Mount Airy Casino in northeastern Pennsylvania’s Pocono Mountains had asked the court to strike down the $10 million host fee, arguing that it violates the state constitution by imposing a heavier tax burden on lower performing casinos.

Some $141 million in slots revenue was paid in the last fiscal year to counties and municipalities, according to Pennsylvania Gaming Control Board data. That included about $48 million paid by casinos to satisfy the $10 million host fee requirement.

Gov. Tom Wolf’s office declined comment on the ruling Wednesday. Senate officials said the decision could have far-reaching effects.

“We will take action and we’ll do it in such a way to maintain the casino obligation to our local communities,” Senate Appropriations Committee Chairman Patrick Browne, R-Lehigh, told the Morning Call of Allentown. “This would absolutely devastate these towns.”

Douglas Hill, executive director of the County Commissioners Association of Pennsylvania, said the money is significant for counties.

“Very clearly, the gaming revenue has gone to legitimate and worthwhile local purposes, all aimed at improving the community, and equally for the host municipalities,” Hill said.

The amount of the host fee is equivalent to the cost of 100 police officers, Bethlehem Mayor Robert Donchez told the Morning Call.

“So this is something that we’re very concerned about,” Donchez said.

The court also awarded relief to Mount Airy Casino, although the amount was not immediately clear.