NEW YORK (AP) — The nation's two largest daily fantasy sports websites have agreed to stop taking paid bets in New York through the end of baseball season, in September, as lawmakers consider legalizing the popular online contests, the state's attorney general announced Monday.

"As I've said from the start, my job is to enforce the law, and starting today, DraftKings and FanDuel will abide by it," Attorney General Eric Schneiderman said in a statement.

Schneiderman sued Boston-based DraftKings and New York-based FanDuel after sending them cease-and-desist letters last November, arguing they were essentially illegal gambling operations and violating state laws.

The companies denied the charges, arguing fantasy sports games are games of skill, not chance.

In a statement, a spokesman for DraftKings said company officials would continue to work with state legislators to find a way to allow fantasy sports to operate without ambiguity. A spokesman for FanDuel didn't immediately respond to a request for comment.

The companies had been allowed to continue operating in New York after an appeals court stayed a lower court judge's finding that the contests violated state law. But credit card processors and others had become nervous by the litigation, threatening play for hundreds of thousands of daily fantasy sports enthusiasts.

The increasingly popular companies had drawn the eye of regulators throughout the country after a blitz of advertising ahead of the 2015 NFL football season depicted the contests as easy ways for average sports fans to win big money.

But critics and consumer advocates noted that only the top skilled players actually won most contests, and regulators warned that gamblers and young players in particular were at risk of losing more than they could possibly win.

The sites' business models have come under scrutiny in other states as well, such as Illinois and Nevada.