New York's attorney general on Tuesday ordered the daily fantasy sports companies DraftKings and FanDuel to stop accepting bets in the state, saying their operations amount to illegal gambling.

In a pair of letters sent to the companies, Attorney General Eric Schneiderman said that after a one-month investigation, his office had concluded that the daily contests are essentially games of chance, not skill.

He drew a sharp distinction between the operations of daily fantasy sports sites and traditional fantasy leagues, which he said were legal partly because they relied on months of smart play over the course of several months. DraftKings and FanDuel contests, he wrote, are about "instant gratification" and involve no long-term strategy.

Schneiderman also said advertisements by the two companies, including one from Draft Kings promoting the site as "the simplest way of winning life-changing piles of cash," misled players about their chances of winning. The top 1 percent of players, he wrote, take home most of the prizes.

"Daily fantasy sports is neither victimless nor harmless, and it is clear that DraftKings and FanDuel are the leaders of a massive, multibillion-dollar scheme intended to evade the law and fleece sports fans across the country," Schneiderman said in a statement issued after the letters were sent.

Both companies insisted that their games are legal and based on skill and said they were reviewing their legal options. Schneiderman's letter gave the companies five days to respond and show why he shouldn't initiate legal action.

"This is a politician telling hundreds of thousands of New Yorkers they are not allowed to play a game they love and share with friends, family, co-workers and players across the country," FanDuel said in a statement. "The game has been played — legally — in New York for years and years, but after the attorney general realized he could now get himself some press coverage, he decided a game that has been around for a long, long time is suddenly now not legal."

DraftKings said it was disappointed in Schneiderman's action, "particularly since he did not take any time to understand our business or why daily fantasy sports are clearly a game of skill." It said the company would "vigorously pursue all legal options available to ensure our over half a million customers in New York state can continue to play the fantasy sports games they love."

FanDuel's offices are in New York. DraftKings is headquartered in Boston.

Schneiderman's actions were aimed only at the two companies but could serve as a warning for other companies with similar operations.

Fantasy sports has been a popular U.S. pastime for years, but daily contests, where winners and losers are decided in one night, rather than over the course of a season, have exploded in popularity recently. DraftKings and FanDuel have advertised heavily on the Internet and TV ahead of and during the 2015 NFL season.

The sites have come under increased scrutiny since it was revealed last month that a midlevel DraftKings employee playing fantasy football beat more than 200,000 other players, winning $350,000 on rival FanDuel. The case raised questions about insider trading after game data not publicly accessible was inadvertently posted online.

The companies have said their employees didn't appear to violate industry rules but launched internal probes and barred their workers from playing on rival websites.

News of that episode prompted Schneiderman to ask the companies to turn over information.

Nevada regulators ordered the sites to shut down on Oct. 15, ruling that they couldn't operate in the state without a gambling license. States including New Jersey, Pennsylvania, Massachusetts and Georgia have considered enacting their own rules.