Boston-based daily fantasy sports site DraftKings and rival site FanDuel are vowing to fight a cease-and-desist order from the New York Attorney General.

In letters sent to both companies on Tuesday, New York attorney general Eric Schneiderman wrote that the sites’ operations “constitute illegal gambling under New York law” because they are games of chance.

“DraftKings’ customers are clearly placing bets on events outside of their control or influence,” he wrote.

DraftKings has drafted a former state attorney general to help argue its case. Former Massachusetts AG Martha Coakley is now with the law firm Foley Hoag, and is a legal advisor to DraftKings. She says Schneiderman is wrong when he says daily fantasy sports are a game of chance.

“What he failed to do, I think, is look properly at the determination of this business model as something that is much more clearly a game of skill,” Coakley said. “And secondly, if he’s concerned about consumer protection issues, DraftKings and others have been willing to work with him, and will continue to do to make sure consumers are protected.”

Coakley said the New York Attorney General’s decision would have a “huge impact” on the industry.

“We’re looking at an industry that employs almost 400 people. It’s a leader in consumer tech. It has the opportunity to grow jobs and other businesses here. And before legislatures or AGs or a governor just says ‘no you can’t play here,’ there should be more determination of what it is.”

Coakley says government is often behind when it comes to new technologies.

“And as a result of which, unfortunately, without enough analysis they sometimes inappropriately regulate, and in the case of New York I would say over-regulate.”

DraftKings and FanDuel have five days to respond to the New York letter before Schneiderman can take them to court to compel them to stop operating in the state. Coakley says DraftKings intends to challenge the cease-and-desist, and they’re reviewing their options. FanDuel is vowing to defy the order.