STATEN ISLAND - The Mayor's office says the city is appealing the ruling by a Staten Island judge.
For now, that judge is siding with Staten Island residents.
They say it doesn't belong in their neighborhood and the judge agrees.
Carla Mohan is a Staten Island resident.
Those voices have angrily protested for weeks against using a former catholic high school in Staten Island to house migrants.
Staten Island Supreme Court Justice Wayne Ozzi now ruling the city must immediately stop using the school as an emergency shelter.
New York is a sanctuary city meaning it will not turn away asylum seekers.
The city also has a right-to-shelter mandate which was implemented more than 40 years ago. It requires shelter for the homeless.
Since the Spring of last year, more than 116 thousand migrants have arrived in the city.
Republican New York State Assembly Member Michael Tannousis represents parts of Brooklyn and Staten Island.
"Judge Ozzi also told us today something all of us here already know that the right to shelter law applies to New Yorkers, to people that live in the Unites States. It doesn't apply to the 8 billion people that live around the globe," Tannousis said.
City Hall releasing a statement saying the city will appeal the judge's ruling "which threatens to disrupt efforts to manage this national humanitarian crisis."
At the same time, the city was, once again, in court trying to modify the right-to-shelter mandate hoping a judge will grant the city the right to exclude migrants.
The Legal Aid Society wants to preserve right to shelter and is fighting the city.
The judge in the right-to-shelter case has given the city until October 3rd to submit specific changes it wants to make to the housing mandate.