Chicago will sue President Donald Trump's administration over threats to withhold public safety grant money from so-called sanctuary cities, Mayor Rahm Emanuel has said.

Emanuel said on Sunday that Chicago won't "be blackmailed" into changing its values as a welcoming city, escalating a pushback against a federal immigration crackdown.

The lawsuit will be filed on Monday.

It comes less than two weeks after Attorney General Jeff Sessions announced that the US Department of Justice (DOJ) would bar cities from a public safety grant programme unless they share information with federal immigration authorities.

Sanctuary cities generally offer undocumented immigrants safe harbour by declining to use municipal resources to enforce federal immigration laws.

"Chicago will not let our police officers become political pawns in a debate," Emanuel, a Democrat, said at a news conference.

READ MORE: Can New York remain a sanctuary city?

"Chicago will not let our residents have their fundamental rights isolated and violated. And Chicago will never relinquish our status as a welcoming city."

The city stands to lose about $3.2m under the new policy.

The grant was to go towards purchasing police equipment.

Emanuel said the lawsuit would prevent the Trump administration from setting a precedent that could be used to target other funding.

The DOJ did not immediately comment on Sunday.

Last week, Sessions decried sanctuary cities, saying they "make all of us less safe" and impede law enforcement by setting criminals free.

He said cities would be barred from the Edward Byrne Memorial Justice Assistance Grants unless they allow immigration authorities unlimited access to local jails, and provide 48 hours notice before releasing anyone wanted for immigration violations.

Police and city officials in sanctuary cities say deporting undocumented immigrants, who are not accused of serious offences, harms public safety, because it discourages them from reporting crimes.

Dozens of local governments and cities, including New York, Los Angeles and Chicago, have joined the growing sanctuary movement.

The Trump administration has already faced legal battles over its sanctuary city policies.

Last month, a US judge refused to revisit a court order that blocked an executive order denying broader federal funds to such jurisdictions, in a case filed by San Francisco and the California county of Santa Clara.