Hours after a New York judge on Friday granted the state attorney general’s injunction barring the two largest daily fantasy sports sites, FanDuel and DraftKings, from operating in the state, an appeals court judge allowed the companies to keep operating until the legality of their games can be further considered.

The decision by the appellate judge, Associate Justice Paul G. Feinman of the Appellate Division of the State Supreme Court, came in an emergency hearing in which lawyers for DraftKings argued that if the company were forced to shut down even temporarily, it would be irreparable harmed. The stay by Justice Feinman allowed the companies to do business in New York until at least Jan. 4.

Earlier Friday, Justice Manuel J. Mendez of State Supreme Court had granted the request by the attorney general, Eric T. Schneiderman, for a temporary injunction. Justice Mendez did not rule on the merits of the case and asked both sides to submit more evidence, but he said he thought the attorney general’s office would win on the merits of the case. A panel of judges will decide in January whether Justice Mendez’s injunction will stay in place.

“The balancing of the equities are in favor of the N.Y.A.G. and the State of New York due to their interest in protecting the public, particularly those with gambling addictions,” Justice Mendez wrote.