CHICAGO — New York-based FanDuel and Boston-based DraftKings filed separate lawsuits against Illinois Attorney General Lisa Madigan on Thursday, a day after she declared daily fantasy sports betting illegal in the state. The companies argue that their contests are games of skill allowed by state law. They’re seeking to stop Madigan from enforcing her interpretation of the law and putting them out of business in Illinois.

Madigan’s action “has set off a chain of events that – if unchecked – will unjustly destroy a legitimate industry,” the lawsuit filed by DraftKings in Cook County Circuit Court in Chicago contends. The Illinois decree followed decisions in New York and Nevada to ban the online sites as illegal gambling.

Attorney Randy Mastro, who represents DraftKings, 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.

FanDuel filed its lawsuit in Illinois’ Sangamon County along with Arizona-based Head2Head Sports LLC, a season-long fantasy contest operator. The state capital of Springfield is located in Sangamon County, and state lawmakers there will consider a measure to regulate the contests.

A Madigan spokeswoman said the attorney general’s office would have no comment on the companies’ lawsuits outside of Wednesday’s opinion.