Boston-based DraftKings filed a lawsuit against Illinois Attorney General Lisa Madigan on Thursday, a day after she declared daily fantasy sports betting illegal in the state.

Madigan's action "has set off a chain of events that — if unchecked — will unjustly destroy a legitimate industry," the lawsuit filed in Cook County Circuit Court in Chicago contends. The Illinois decree followed decisions in New York and Nevada to ban the online sites for the same reason.

Attorney Randy Mastro, who represents DraftKings, one of two industry leaders, said the company took legal action "so that the hundreds of thousands of Illinois fans who have played openly and honestly for nearly a decade will know they can continue to enjoy the fantasy sports games they love."

Illinois residents make up 10 percent of DraftKings customers, according to the court filing.

Illinois law allows contests with prizes awarded for skill, the lawsuit argues, and the entry fees that DraftKings charges to participate aren't bets or wagers. Contestants use "their strategic know-how and ingenuity to select" a winning lineup, the lawsuit states.

The lawsuit asks the court for an expedited opinion declaring that fantasy games do not constitute gambling within the meaning of Illinois law and nullifying Madigan's Wednesday opinion letter. DraftKings also requests that the court prevent Madigan's office from taking any enforcement action.

Madigan's office did not immediately respond to emailed requests for comment Thursday evening.

Daily fantasy sports differ from the traditional model in that contests are organized around short periods — a week, or a day — instead of a season. Players compete for a predetermined prize by assembling virtual teams of real pro or college athletes; winners are determined based on the statistics those athletes compile.

In her opinion letter, Madigan pointed out that while state law allows prizes or compensation for "actual contestants," that doesn't include fantasy gamblers.

"Persons whose wagers depend upon how particular, selected athletes perform in actual sporting events stand in no different stead than persons who wager on the outcome of any sporting event in which they are not participants," Madigan wrote.

The second major daily fantasy sports operator, FanDuel, issued a statement Wednesday after Madigan's opinion, calling on lawmakers to "give back to the people of Illinois the games they love."

Democratic Rep. Mike Zalewski of Riverside is pushing legislation to legalize and regulate the contests. His proposal would require players to be 18 and allow sites to review players for child support or tax debts.