Eric Soufer, a spokesman for the attorney general, disputed Ms. Macias’s account, and said the attorney general’s office had multiple meetings with representatives from DraftKings before issuing the order.

In response to the letter it received from the attorney general, DraftKings said, “We strongly disagree with the reasoning in his opinion and will examine and vigorously pursue all legal options available.”

In a statement, FanDuel said: “Fantasy sports is a game of skill and legal under New York state law. 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.”

The two companies can challenge the attorney general’s order in court. According to Joseph M. Kelly, a professor of business law at the State University College at Buffalo, the state would have to prove that chance is a material factor in fantasy sports, which would make it gambling.

Players who bet on fantasy sports assemble their own teams of professional athletes who compete based on their statistical performances in games. Mr. Schneiderman’s order does not apply to seasonal competitions or to other companies that offer fantasy games.