Fantasy sports company DraftKings will ask a court to decide whether it can offer daily fantasy sports games in Illinois, after the state's attorney general declared them illegal gambling.

The attorney general's ruling is another blow to the two leading daily fantasy sports companies, DraftKings and FanDuel, which are also fighting a legal battle to permanently continue doing business in New York state.

"In light of the opinion, we expect that both FanDuel and DraftKings will amend their terms of use to include Illinois as an additional state whose residents are not eligible to participate in the contests," Illinois Attorney General Lisa Madigan said in a statement on Wednesday.

DraftKings "will continue to abide by all relevant laws and will follow the direction of the courts," the company said in a statement later on Wednesday. "Pending that resolution the company will preserve the status quo.”

FanDuel will pursue all legal options, a spokeswoman said on Thursday.

The Illinois opinion comes amid nationwide scrutiny at the state and federal level as to whether daily fantasy sports games amount to gambling.

DraftKings and FanDuel, on Dec. 11, won a temporary reprieve from a New York judge's order to stop doing business in the state.

In November, New York Attorney General Eric Schneiderman sent cease and desist letters to the companies, demanding that they stop taking money from players in the state. Schneiderman then sought, and won, injunctions against DraftKings and FanDuel from a state trial judge also on Dec 11. Later that day a state appellate court temporarily stayed the order.

The companies, as a result, may continue to operate in New York until at least early January, when the appeals court holds another hearing.

Fantasy sports started in 1980 and surged in popularity online. Participants typically create teams that span an entire season in professional sports, including American football, baseball, basketball and hockey.

Daily fantasy sports, a turbocharged version of the season-long game, have developed over the past decade. Players draft teams in games played in just one evening or over a weekend.

Professional football is the most popular sport for daily fantasy contests.

The companies' business in New York and Illinois could also be saved by legislatures in those states, where bills have been introduced to make the games legal. But the level of support for these bills is unclear.