NEW YORK (CBSNewYork/AP) — The nation’s top two daily fantasy sports websites have agreed to stop operating in New York through the end of baseball season.

New York Attorney General Eric Schneiderman announced the deal with DraftKings and FanDuel on Monday.

READ MORE: NYCFC Rallies Late In Second Half, Stuns Philadelphia Union For Spot In MLS Cup Final

“I’m sorry it took so long and cost so much money but today DraftKings and FanDuel did the right thing,” Schneiderman said.

Schneiderman had sued the companies last year, arguing the sites were illegal sports betting operations and were violating state laws, CBS2’s Steve Overmyer reported. The companies argue their contests are games of skill, not of chance.

“No company, no matter how powerful or well-financed, is above the law,” he said.

Click here and here to read the agreements. (.pdf)

A lower court judge agreed with the attorney general and ordered them to stop, but the companies appealed. A higher state court allowed the companies to do business during the appeals process.

READ MORE: Eagles Remain Undefeated In Their History Against Jets, Score On First 7 Possessions In Easy Win

“Today’s agreement also creates an expedited path to resolve this litigation should that law change or upon a decision by the appellate division,” Schneiderman said. “Regardless, our key claims against the companies for false advertising and consumer fraud are not affected by the agreement and will continue.”

“We are an industry leader in technology, innovation and consumer protections, and we are grateful to the hundreds of thousands of New Yorkers who have enjoyed playing fantasy sports on DraftKings for the last 4 years,” DraftKings said in a statement. “We will continue to work with state lawmakers to enact fantasy sports legislation so that New Yorkers can play the fantasy games they love.”

“New York is a critical state for FanDuel.  FanDuel is headquartered in Manhattan, where we employ more than 170 young smart, passionate fans who are committed to innovating and providing the best fantasy experience possible,” FanDuel said. “We are proud to be one of New York’s largest startup companies, and 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, the fantasy industry and our players while we continue to pursue legal clarity in New York.”

Meanwhile, fans have not only protested Schneiderman’s decision, but have also questioned his right to do so.

“There’s a million people in the state of New York who play on a weekly basis,” one fantasy sports fan said. “And for one person to decide they’re going to take that away randomly — it makes no sense.”

State lawmakers in Albany are considering legislation that would permit the sites to operate without ambiguity.

MORE NEWS: Giants' Offense Sputters, Tagovailova Leads Dolphins To 5th Straight Win

(TM and © Copyright 2016 CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2016 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.)