Two popular fantasy sports websites on Friday filed a lawsuit against New York State Attorney General Eric Schneiderman for trying to stop their websites from operating.

In their filing, DraftKings called the attorney general's cease-and-desist order irresponsible, irrational, and illegal.

Employees from both companies - as well as some fans - also staged a protest Friday outside Schneiderman's Manhattan office.

Earlier this week, Schneiderman ordered both sites to stop accepting what he calls illegal bets.

Both sites allow users to create daily online fantasy teams to compete and win money in contests against other users. 

Schneiderman says both sites have acted in violation of state gambling laws.

In a statement, DraftKings said, in part, "Today, we have taken decisive legal action to prevent a unilateral, misinformed and legally misguided attempt by the New York Attorney General to act as 'judge, jury and executioner' for daily fantasy sports in New York."

FanDuel also released a statement Friday saying, "As we said, this week was only the beginning of the legal process. We have a legal business that millions and millions of people love and we are entitled to due process and look forward to being heard in court."