ALBANY — Gov. Andrew M. Cuomo signed a law Wednesday that legalizes daily fantasy sports games in New York — ending, in time for football season, a lawsuit that called the activity illegal gambling and threatened to shut it down.

The governor’s action clears the way for New York — the biggest market for daily fantasy sports — to resume participating after a lawsuit filed by state Attorney General Eric T. Schneiderman temporarily had halted play here. But the attorney general said he will still pursue related false advertising claims against FanDuel and DraftKings, the companies that control 95 percent of the market.

Political support had built for legalizing the games after Schneiderman’s lawsuit had halted play. Cuomo’s signature came after the legislature overwhelming passed a bill to regulate and tax the activity.

“Daily fantasy sports have proven to be popular in New York, but until now have operated with no supervision and no protections for players,” Cuomo said in a statement. “This legislation strikes the right balance that allows this activity to continue with oversight from state regulators, new consumer protections, and more funding for education.”

Under the new law, companies such as New York-based FanDuel and Boston-based DraftKings, will have to pay the state 15 percent of their gross revenue in taxes and another fee based on 0.5 percent of revenue, not to exceed $50,000 annually. The governor said this would generate an estimated $4 million annually for the state. Companies that had been operating before the lawsuit must obtain a state permit to resume; new companies must apply to the state gaming commission.

Daily fantasy sports teams said they were “thrilled” by the outcome.

advertisement | advertise on newsday

Daily fantasy sports involve fans assembling their “teams” in football, basketball, baseball and other sports based on real-life rosters and statistics. Fans pay fees to host companies, compete against other fans and can win prizes.

Schneiderman’s lawsuit, filed last fall, called the games illegal gambling in part because he considered them “games of chance,” which are prohibited by the state constitution in New York unless expressly approved, such as horse racing. That determination was based on his contention that the outcome — much like horse racing — was out of the fan’s control.

In legalizing daily fantasy sports, lawmakers had to include language in the law that specifically declared them “games of skill” to avoid the constitutional issue.

Supporters said critics didn’t understand the game.

“The big argument was: Is it skill or is it chance? Is it gambling or is it not gambling?” said Assemb. Dean Murray (R-East Patchogue), a vocal supporter of legalization. “You had to educate a lot of people about how the game works. Once you did, you had fewer questions about illegal gambling . . . and the conversation turned toward setting up regulations.”

Schneiderman said he would follow the new law but will continue to pursue false advertising claims against the two largest companies, based on what he’s called misleading ads about odds and prizes.