A state Supreme Court justice late last week ruled daily fantasy sports games in New York violated the state constitution’s ban on gambling, throwing into question the future of apps like FanDuel and DraftKings in New York.

“Based on all of the above, the Court finds and holds that the Constitutional prohibition upon authorization or allowance of pool-selling, bookmaking or any other kind of gambling encompasses (interactive fantasy sports),” Acting Supreme Court Justice Gerald Connolly wrote in his ruling.

The ruling comes after state lawmakers and Gov. Andrew Cuomo agreed to a measure that allowed daily fantasy sports in New York, determining they were games of skill, not games of chance, which are banned in the constitution.

But Connolly’s decision offered lawmakers something of an exit ramp: The games themselves are unconstitutional, but the Legislature could removed daily fantasy sports from being regulated under the state’s penal law.

The ruling is also a victory for the state’s anti-gambling forces, which had been dealt a series of setbacks in recent years, including the expansion of commercial casinos in upstate New York through a constitutional amendment.