Daily fantasy sports sites DraftKings and FanDuel will immediately stop running paid contests in New York amid a months-long fight to operate in the state.

New York Attorney General Eric Schneiderman, who issued a cease-and-desist order to the companies last year, made the announcement on Monday.

“As I’ve said from the start, my job is to enforce the law, and starting today, DraftKings and FanDuel will abide by it,” he said in a statement. “Today’s agreement also creates an expedited path to resolve this litigation should that law change or upon a decision by the appellate division. Regardless, our key claims against the companies for false advertising and consumer fraud are not affected by the agreement and will continue.”

Schneiderman has argued that daily fantasy sports violate state gambling laws, while DraftKings and FanDuel have stressed that they are in compliance with both state and federal laws because their games are skill-based, not by chance.

An appeal of an injunction against the two companies will be heard in September. The hearing may not take place if the state legalizes daily fantasy sports during this legislative session.

“We are an industry leader in technology, innovation and consumer protections, and we are grateful to the hundreds of thousands of New Yorkers who have enjoyed playing fantasy sports on DraftKings for the last four years,” DraftKings said in a statement. “We will continue to work with state lawmakers to enact fantasy sports legislation so that New Yorkers can play the fantasy games they love.”

FanDuel also issued a statement on Monday.

“We are proud to be one of New York’s largest startup companies, and while it is disheartening for us to restrict access to paid contests in our home state, we believe this is in the best interest of our company, the fantasy industry and our players while we continue to pursue legal clarity in New York,” it reads.