A federal judge's ruling on Tuesday prevents two Hudson Valley counties from enforcing executive orders against housing migrants, but does not affect temporary restraining orders, granted by a state judge last month, that blocks New York City from relocating them to the counties.

A U.S. District Court granted the New York Civil Liberties Union (NYCLU) request for restraining orders against Dutchess and Rockland counties. The judge found the counties’ executive orders violated the U.S. Constitution and discriminates against asylum seekers based on their national origin.

Orange and Rockland counties issued the orders last month, when New York City announced plans to move migrants to other parts of the state on a temporary basis. NYC officials then bused migrants to hotels in Orangeburg and Newburgh.

County leaders claimed they don't have the resources to handle a sudden influx of people, and both areas acquired temporary court orders blocking New York City from sending more people.

"My administration is considering all legal options including an appeal of the decision," Rockland County Executive Ed Day said in a statement Tuesday afternoon.

He claimed the local emergency order never barred anyone from coming to the county.

"The only thing this County’s order was barring was (New York City) Mayor Eric Adams from overstepping his authority by luring people out of New York City with predatory marketing and advertising and turning hotels in Rockland into city-run shelters with no regard for law, zoning, or our capacity on hand," Day said.

Joshua Goldfein, an attorney with the Legal Aid Society, said the court found NYCLU are likely to be able to prove the counties' intent in adopting the emergency orders (EOs) was discriminatory.

"On that basis, the Court enjoined the EOs. The court said it would not disturb the state court's orders because of federalism concerns, but to the extent that those orders relied on the enjoined EOs, they should be vacated," Goldfein said.

Orange County released a statement on Tuesday evening, saying its temporary restraining order against New York City will remain in effect at least until June 21, when the state Supreme Court could issue a ruling on it.

“The County disagrees with the ruling by the federal court today that Orange County’s Executive Order preventing hotels in Orange County from accepting NYC’s homeless is unconstitutional," the statement reads. "However, the important result of that ruling is that nothing really changes as a practical matter at the present time."