New York City law protects the right to shelter, and the move could raise legal challenges, advocacy groups said.

The attempt “to dissuade immigrants from coming to New York City is cruel, unlawful, and flies in the face of New Yorkers’ values of compassion and care,” the American Civil Liberties Union of New York wrote on Twitter.