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.

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

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.

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