(Bloomberg) -- New York City sued 30 upstate and Long Island counties for issuing executive orders blocking local hotels and motels from contracting to house migrants sent from the city. 

The city filed suit Wednesday in state court in Manhattan. Mayor Eric Adams said in a statement that the suit was aimed at ending “xenophobic bigotry” on the part of county and local officials. The mayor has been vocal about the challenges facing the city due to an increase in migrants, many of them sent to New York by Republican governors like Texas’s Greg Abbott.

“Since this crisis began, New York City has — virtually on its own — stepped up to provide shelter, food, clothing, and other services to asylum seekers arriving in our city,” Adams said Wednesday. “We are doing our part and will continue to do our part, but we need every locality across the state to do their part as well.”

The 30 counties named in the suit included Suffolk, Rockland, Orange, Putnam and Dutchess. Officials in four of those counties didn’t respond to requests for comment. In a statement, Dutchess County Executive William O’Neil said the county’s “actions to this point are legitimate and have been made with the best interest of all involved.” 

New York City claims the counties’ actions exceed their authority and also violate the state human rights law and the US Constitution’s equal protection clause. The suit comes a day after a federal judge in Westchester County blocked executives orders by Rockland and Orange Counties, saying they were likely unconstitutional.

Read More: New York City Suspends Shelter Rules as Migrant Numbers Jump

In the past year, more than 74,000 migrants over the southern border have arrived in New York, according to the Adam’s office, with more than 47,000 remain in city-supported housing. After New York governor Kathy Hochul last month declared a statewide emergency, the mayor announced a “new, voluntary program” which would allow migrants to leave makeshift city shelters and move into hotels in other counties. The city contracted with a number of properties individually.

In response, Rockland County Executive Ed Day issued an order prohibiting local motels and hotels from contracting to accept such migrants. Orange County executive Steven Neuhaus followed suit. 

US District Judge Nelson Roman in White Plains, New York, on Tuesday temporarily blocked those orders. Roman cited “racially-charged comments” by officials in find that the two counties’ orders may have been motivated by discriminatory intent. 

The city on Wednesday accused upstate counties of trying to “wall off their borders” to the migrants.  Their actions were “premised on specious claims that the prospect of a few hundred asylum seekers sheltered at the City’s expense would somehow constitute an emergency imperiling public safety,” according to the suit.

Some counties have also sued the city, challenging its authority to send migrants to other parts of the state.

(Updates with comment from Dutchess County executive in fourth paragraph.)

©2023 Bloomberg L.P.