Fantasy sports won a major legislative victory in New York early Saturday as state lawmakers moved to legalize the daily and seasonlong online games, after months of being halted by the state’s attorney general.

The multibillion-dollar industry, where players draft fantasy teams for sports including football, basketball and baseball, has drawn increased scrutiny since last year with the attorneys general of several U.S. states, including New York, Illinois and Nevada, questioning the legality of the games offered by the likes of FanDuel, DraftKings and others.

Attorney General Eric T. Schneiderman, who first declared war on the industry last fall by referring to fantasy sports as illegal gambling, had laid the groundwork for a deal in March when he suggested a June 30 deadline for the Legislature to act to address the games' legality.

New York's Senate passed the measure 45-17 Saturday thereby sending the legislation that regulates and taxes the operators of fantasy sports games to Gov. Andrew Cuomo. It is unclear if he will give his approval but the final legislation included proposed modifications from his staff, suggesting at least some degree of support.

State Assembly Gaming Committee Chairman J. Gary Pretlow predicted Cuomo will endorse the bill as many young New York voters play the fantasy games that would generate tax revenues.

“It’s a good thing for New Yorkers because there are more than three and half million participants, most of them millennials,” Pretlow​ said, according to Reuters.

The legislation calls for a 15 percent annual state tax on gross revenues of all sports fantasy contests with an entry fee and another 0.5 percent to be assessed each year on the companies with a maximum of $50,000, reports say.

The decision comes soon after two of the largest daily fantasy sports companies and erstwhile rivals, FanDuel and DraftKings, were said to be in early-stage talks to merge, people familiar with the matter said Monday.