WASHINGTON (Reuters) - The U.S. Department of Justice threatened on Friday to cut some funding to California as well as eight cities and counties across the United States, escalating a Trump administration crackdown on so-called sanctuary cities that do not cooperate with federal immigration authorities.

Immigrant-rights advocates protest near the U.S.-Mexico border wall over a visit to the border by U.S. Attorney General Jeff Sessions and Secretary of Homeland Security John Kelly in San Ysidro, a district of San Diego, California, U.S., April 21, 2017. REUTERS/Mike Blake

President Donald Trump has vowed to strip federal funds from dozens of state and local governments that do not fully cooperate with U.S. immigration agents, arguing they endanger public safety when they decline to hand over for deportation illegal immigrants who are arrested for crimes.

“Sanctuary cities” in general offer safe harbor to illegal immigrants and often do not use municipal funds or resources to advance the enforcement of federal immigration laws.

Many of these localities say they do not have the funding or space to hold immigrants until federal agents can take custody of them.

Those threatened were: the state of California; New York City; Chicago; Philadelphia; Clark County, Nevada; New Orleans; Miami-Dade County, Florida; and Milwaukee County, Wisconsin. Cook County, Illinois, also received a warning, even though it did not get money from the Justice Department last year.

The jurisdictions have until June 30 to provide evidence to the federal government that they are not violating any laws.

At stake is roughly $29 million in law enforcement aid under the Edward Byrne Memorial Justice Assistance Grant Program, which helps local governments pay for everything from forensics labs to drug courts.

The grants in question are among the largest handed out under the program, collectively amounting to 11 percent of the $256 million distributed in the last fiscal year.

In a statement, the Justice Department singled out Chicago and New York as two cities that are “crumbling under the weight of illegal immigration and violent crime,” even though New York City is experiencing its lowest crime levels in decades and experts say Chicago’s recent spike in violent crime has little to do with illegal immigration.

Several state and local officials responded with defiance to the threat.

“New York is the safest big city in the country, with crime at record lows in large part because we have policies in place to encourage cooperation between NYPD and immigrant communities,” said Seth Stein, a spokesman for New York City Mayor Bill de Blasio.

In California, the state Senate approved a bill earlier this month to curb cooperation between police agencies and federal agents seeking to deport illegal immigrants. The measure is now in the state Assembly.

“It has become abundantly clear that Attorney General (Jeff) Sessions and the Trump administration are basing their law enforcement policies on principles of white supremacy - not American values,” California Senate President Pro Tempore Kevin de León, a Democrat, said in a statement on Friday.

A spokeswoman for the California Board of State and Community Corrections said some of the federal funding in question went to local communities after emergencies, including San Bernardino after a mass shooting there in 2015.

Officials in Philadelphia, Milwaukee County and Cook County said they believed they were complying with immigration laws.

“Milwaukee County has its challenges but they are not caused by illegal immigration. My far greater concern is the proactive dissemination of misinformation, fear, and intolerance,” said Milwaukee County Executive Chris Abele.

The Fraternal Order of Police, the largest police union, told Trump in a meeting last month that they were concerned the cuts could threaten public safety.