NEW YORK (Reuters) - Top daily fantasy sports companies FanDuel and DraftKings agreed to halt their business in New York on Monday, betting on a legislative path to make the games legal after a months-long fight with the state’s attorney general.

A FanDuel logo is displayed on a board inside of the DFS Players Conference in New York November 13, 2015. REUTERS/Lucas Jackson - RTS6UCJ

New York Attorney General Eric Schneiderman said the companies agreed to immediately stop operating paid contests in the state. An appeal of an injunction against the companies is slated to be heard by the state’s Appellate Division in September.

The settlement means the companies would not have to pay any fines or other penalties related to the gambling charges, even if they are found to have been operating illegally.

“This is a decisive and important victory for the rule of law in New York state,” Schneiderman said at a news conference. “No company or individual no matter how powerful or well financed is above the law.”

New York is one of the largest markets for daily fantasy sports in the United States. According to court filings, the state was DraftKings’ second biggest by revenue in 2014.

Under the settlement, if daily fantasy sports are legalized in New York this year, the gambling claims against the companies would be dropped. The privately held companies could still face charges for false advertising or consumer protection issues.

Bills have been proposed in New York’s state legislature to make the games legal, one of which was recently attached to the state budget. That means the matter could be considered as soon as this week.

The settlement “brings this issue to the forefront and I look forward to working with my colleagues in the Senate and Assembly, and the governor, to see it addressed during the budget process,” New York state Senator John Bonacic, a Republican who proposed one of the bills, said in a statement.

That bill contains a one-time registration fee of $500,000 that daily fantasy sports companies would have to pay in order to operate in New York, which could lock out smaller competitors of DraftKings and FanDuel.

FanDuel and DraftKings make up the vast majority of the daily fantasy market. Yahoo Inc is a distant third.

Yahoo was issued a subpoena by Schneiderman in November but was not named as part of the injunction. Michael La Guardia, the head of product at Yahoo Sports, said the company was “watching developments closely and considering options.”

“We believe we’re acting inside of the law across the board here and we’ll always make sure that we do so,” he said.

Fantasy sports started in 1980 and surged in popularity online. Participants typically create teams that span an entire season in professional sports.

Daily fantasy sports, a turbocharged version of the season-long game, have exploded in popularity over the past decade. Players draft teams in games played in just one evening or over a weekend.

CEASE AND DESIST

Daily fantasy sports enable fans to spend money on the games with a frequency that critics say is akin to sports betting.

The multibillion-dollar industry has drawn increased attention from state regulators over the past year, with the attorneys general of New York, Illinois and Nevada challenging the games’ legality.

Schneiderman in November declared the games to be illegal gambling and demanded that the companies stop taking bets in New York.

But a New York state judge in December issued an injunction against the companies that was soon suspended by a higher court.

“New York is a critical state for FanDuel,” the company said in a statement. “While it is disheartening for us to restrict access to paid contests in our home state, we believe this is in the best interest of our company.”

DraftKings said it would continue to work with state lawmakers to enact legislation to ensure the games are deemed legal.

The companies have raised hundreds of millions of dollars from investors including Fox Sports, Major League Baseball, the National Hockey League, KKR & Co LP, Raine Group, Google Capital and the venture arms of Time Warner Inc and Comcast Corp.

DraftKings also partnered with Major League Baseball to advertise in ballparks, while FanDuel signed partnerships with several NFL teams.