Six states and New York City are suing the federal government, saying it is unconstitutional for the government to withhold anti-crime funds from the so-called sanctuary cities and states in order to force them to engage in federal immigration enforcement.

The city and a coalition of states, including New York, filed separate lawsuits Wednesday that charge that conditions now being placed on the federal funding are illegal.

As a so-called sanctuary city, New York does not notify federal authorities when an undocumented immigrant has been arrested, unless he or she is convicted of a serious crime.

The Trump administration opposes such policies, and has begun withholding certain federal public safety funds to cities and states that do not turn over all information about the undocumented.

The lawsuits say the Justice Department has withheld $4 million from the city and threatened to rescind millions of dollars that the city received previously.

The lawsuits also say the state could lose $9 million.

The litigation filed seeks a judge's declaration that the policy change announced last year and enforced beginning last month is unconstitutional.

The mayor and governor say the sanctuary policies make New York safer, by encouraging the undocumented to report crimes and cooperate with police.