The millions who play and lose on daily fantasy sports websites are engaged in gambling, plain and simple. Now, state and federal officials are finally starting to clamp down on this fast-growing online business.

On Tuesday, the attorney general of New York, Eric Schneiderman, sent cease-and-desist letters ordering the two leading daily fantasy sports companies — FanDuel and DraftKings — to stop taking bets from the state’s residents. Last month, Nevada regulators said fantasy sports games are forms of gambling, not games of skill, and ordered the companies to suspend operations until they received gaming licenses. The U.S. attorney in Manhattan has also begun an investigation.

Traditionally, fantasy sports are games played among friends over several months. Each player assembles a hypothetical team of athletes, with points calculated based on how those athletes do in actual games. In recent years, FanDuel and DraftKings have introduced daily versions of these games that people pay entry fees to play online. The top 1 percent of DraftKings’ winning bettors, Schneiderman said, “receive the vast majority of the winnings.”

Schneiderman argues that these daily games are illegal under New York law, which defines gambling as any contest played for money that “depends in a material degree upon an element of chance,” even if some skill is involved. The law also says that gambling includes betting on an “event” whose outcome is not under the “control or influence” of the player.

DraftKings and FanDuel, whose investors include sports leagues and Google and Comcast, reject New York’s argument and say skill is much more important than luck. The companies also argue that a federal law, the Unlawful Internet Gambling Enforcement Act, which prohibits online gambling, includes an exception for fantasy sports. But that law does not override other federal and state gambling laws.

Ultimately, states will have to decide this matter. For instance, laws in Arizona, Iowa, Louisiana, Montana and Washington have kept daily fantasy sports companies out. Yet Kansas legalized fantasy sports earlier this year.

Even in states where daily fantasy sports are legal, they need to be regulated. Last month, a DraftKings employee accidentally disclosed internal data about athletes picked in fantasy football games. That employee won $350,000 playing on FanDuel. Though the companies say the employee did not benefit from the data, the incident shows that these businesses cannot police themselves. Regulators should require basic measures, including procedures that prevent the misuse of betting data.

Lawmakers should also be concerned about the effect daily fantasy games have on the bettors. The National Council on Problem Gambling, an advocacy group, recently said people who play these games “are at high risk to, and do, develop gambling problems.”

Gambling in all of its forms has always been enticing, and subject to strict regulations. Daily fantasy sports should be no different.