LOS ANGELES (CBSLA/AP) – In response to a lawsuit brought by the city of Los Angeles, a federal judge has ruled that the Trump administration cannot withhold federal grants from cities which refuse to cooperate with federal immigration policies.

In a news conference Thursday, Los Angeles City Attorney Mike Feuer announced that L.A. had secured a nationwide injunction which prevents the U.S. Department of Justice from giving bonus points to jurisdictions seeking community policing grant funds if they agree to focus efforts on illegal immigration.

“A federal court granted our request for a nationwide injunction, which will prevent the Trump administration from imposing civil immigration-related considerations on a public safety grant,” said Feuer as he was flanked by both L.A. Mayor Eric Garcetti and L.A. Police Chief Charlie Beck. “In particular, the grant at stake here, is the grant for community-based policing.”

Last September, the city of Los Angeles sued the DOJ over its plan to sanction cities that refuse to cooperate with federal immigration enforcement efforts.

The city’s lawsuit alleged that it’s unconstitutional to tie federal grant funding for law enforcement programs to immigration enforcement. It claimed the move creates an “untenable choice” for cities, which must commit to assisting federal immigration enforcement efforts or sacrifice these funds.

“There is no evidence, that there any findings or data in the record, to support the…claim, that cities and states that cooperate with federal law enforcement, make all of us safer by helping to remove dangerous criminals from communities,” U.S. District Judge Manuel Real said in his decision.

RELATED: Trump Praises Brown For National Guard Troop Deployment

L.A. routinely applies for federal grant funds through the Community Oriented Policing Services (COPS) program, and received $3 million last year, according to the city.

“Historically, the LAPD has used this COPS funding, to fund our Friday Night Lights program, to fund programs for at risk-youth,” Feuer said Thursday. “Today, a federal court rejected all the administration’s arguments in very clear language.”

U.S. Attorney General Jeff Sessions in 2017 said jurisdictions that receive a COPS grant would need to commit to a number of new rules, including notifying immigration agents before releasing jail inmates, and giving federal agents access to their detention facilities and data files.

L.A. had previously received COPS funds in 2012 and 2016, but was not awarded the grant in 2017.

“Today the court said loud and clear what we have said loud and clear: Quit politicizing public safety,” Garcetti added.

Last August, Sessions moved to punish San Bernardino and three other so-called sanctuary cities, threatening to deny them federal crime-fighting resources if they don’t step up efforts to help detain and deport people living in the country illegally. However, in October, a federal judge in Chicago ruled that Sessions cannot follow through with his threat to withhold public safety grant money.

Sanctuary cities in the Southland include San Bernardino, Santa Ana and Malibu. Last October, Gov. Jerry Brown signed into law a bill making California a sanctuary state.

(© Copyright 2018 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)