NEW YORK (CBSNewYork/AP) — The Brooklyn District Attorney’s office has unveiled a new policy that changes the way some undocumented immigrants are prosecuted – so as to help keep them in the country.

As WCBS 880’s Alex Silverman reported, the idea of the policy is to prosecute low-level crimes in such a way that the result will not lead to deportation if the person was born in another country.

Acting Brooklyn District Attorney Eric Gonzalez will hire two immigration lawyers to train prosecutors and to consult on individual cases to make sure that guilty pleas do not trigger federal immigration laws. That could mean substituting one charge for another.

Gonzalez said he is not trying to “frustrate the federal government’s function of protecting our country, but we are determined to see case outcomes are proportionate to the offense as well as fair and just for everyone.”

Last week, the Trump administration announced plans to crack down on so-called sanctuary cities that refuse to cooperate with federal immigration authorities – of which New York is one.

The Justice Department is forcing the nine communities to prove they are complying with an immigration law by June 30 to continue receiving coveted law enforcement grant money.

It is an extension of Attorney General Jeff Sessions’ repeated threats to crack down on sanctuary communities by denying or stripping them of grant money.

Officials there must provide proof from an attorney that they are following the law.

In a news release last week, the Department of Justice said many of the jurisdictions are “crumbling under the weight of illegal immigration and violent crime.”

“New York City continues to see gang murder after gang murder, the predictable consequence of the city’s ‘soft on crime’ stance,” the release said.

Mayor Bill de Blasio’s Press Secretary Eric Phillips tweeted, “Yeah, in fact, the NYPD is so soft on crime it has figured out how to prevent it better than anyone else in the nation.”

De Blasio and police Commissioner James O’Neill also both personally slammed the DOJ’s remarks.

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