Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The Justice Department told 23 local governments Wednesday that they must prove they are abiding by an immigration law if they want to continue receiving money under a federal crime-fighting program, turning up the heat over the issue known as sanctuary cities.

The letters demand documentary proof that their police and sheriff's deputies are sharing information with federal immigration agents. If the communities refuse to respond, a Justice Department official said, the government would issue subpoenas ordering them to comply.

"I continue to urge all jurisdictions under review to reconsider policies that place the safety of their communities and their residents at risk," Attorney General Jeff Sessions said.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

U.S. Attorney General Jeff Sessions waits to be introduced to speak at PortMiami on what he said is a growing trend of violent crime in sanctuary cities on Aug. 16, 2017 in Miami. Joe Raedle / Getty Images file

Three states received the letters — California, Illinois and Oregon. Among major cities were Chicago, Denver, Los Angeles, New York and San Francisco.

The letters said they would not be awarded new grants and that the government might come after them to return money they've received in previous grants if they are found to be out of compliance.

Related: Is Trump carrying out mass deportation? Feels like that way to some

Beginning in the Obama administration, the Justice Department warned local governments that in order to receive money under a crime-fighting grant program, they must not block their law enforcement officers from giving information to federal immigration authorities. Wednesday's letters ask for proof of compliance.

Specifically, the Justice Department seeks documentation that local law enforcement is not prohibited from communicating with federal immigration agents when asked for information about undocumented migrants in local jails.

Federal courts have blocked the Trump administration from withholding grant money from local governments that refuse to give immigration authorities advance notice before illegal immigrants are released from custody or that decline to allow immigration agents to visit local jails.

Wednesday's letters involve the separate issue of whether local authorities are prohibited from giving any information to immigration agents about people in their custody.

The letters were sent to Bernalillo County, New Mexico; Burlington, Vermont; California and the cities of Berkeley, Fremont, Los Angeles, Sacramento, San Francisco and Watsonville, and the counties of Monterey and Sonoma; the City and County of Denver, Colorado; Illinois, the city of Chicago and Cook County; Jackson, Mississippi; King County, Washington; Lawrence, Massachusetts; Louisville, Kentucky; New York City and Albany, New York; Oregon; and West Palm Beach, Florida.