The state attorney general took another step to limit local law enforcement's cooperation with federal immigration officials, intensifying a showdown with two South Jersey sheriffs.

Attorney General Gurbir Grewal on Friday blocked authorities from participating in a U.S. program that trains corrections officers to determine the immigration status of jail inmates and then "flag" them for federal action. At the same time, he expanded the list of criminal offenses where notice to immigration officials is permitted.

The changes, announced during a press conference in Newark, seek to prohibit the sheriff’s departments in Monmouth and Cape May counties from continuing with so-called 287(g) agreements that have allowed some of their officers to act as immigration agents in the jails. Grewal gave the sheriffs seven days to wind down the programs.

Both departments renewed agreementswith U.S. Immigration and Customs Enforcement for a decade earlier this year, defying an attorney general’s directive that required state approval for such contracts. The move drew a sharp response from the AG’s office, which demanded justifications as to why the partnerships should be allowed to continue.

“The goal of the Immigrant Trust Directive is clear — to make it easier for New Jersey’s law enforcement officers to solve crimes and ensure the safety of all 9 million people in our state by building trust with our large and diverse immigrant communities,’’ Grewal said Friday. “Because of the bright line between New Jersey law enforcement officers and federal civil immigration agents, immigrants can come forward as victims and witnesses of crimes without fear of reprisal."

The move was a “disappointing day for law enforcement," Monmouth County Sheriff Shaun Golden said in a statement, adding that he would pursue legal remedies.

“Law enforcement throughout Monmouth County never wants to be faced with a situation where a dangerous, undocumented immigrant is released from jail and poses a threat to a community,’’ Golden said. “However, this sanctuary directive will make our communities less safe, since it places people in those communities at risk for increased violence."

The Cape May sheriff’s department did not reply to requests for comment. In a written response to the AG last month, Sheriff Robert Nolan attached a list of five individuals charged with various crimes who he said were deemed “egregious” by ICE. Corrections officers detained the immigrants and notified the agency as a result of the training, he said.

ICE RAIDS:54 people arrested in five-day immigration sweep in New Jersey

DEPORTATION ORDER:'Real Housewives of NJ's' Joe Giudice asks to wait in Italy while he fights to stay in US

An ICE spokesman, Khaalid Walls, cited comments earlier this week by the agency's acting director, Matthew Albence. About 70 percent of the arrests ICE makes occur after the agency is notified about an immigrant being released from a local jail or prison, he said.

"It is past time to put aside all the political rhetoric and listen to the facts — and the fact is people are being hurt and victimized every day because of jurisdictions that refuse to cooperate with ICE,'' Albence said.

Grewal said nothing in the directive would provide "sanctuary" to criminals and said the federal program wasn't necessary. On average, he said 2,400 individuals are arrested every week for state offenses in New Jersey.

"We are the ones arresting them in the first place, we are the ones who are going out there investigating violations of state law, whatever the crime may be,'' he said. " We are the ones who are then prosecuting them in court."

In the most serious cases, law enforcement in New Jersey has notified ICE about undocumented immigrants facing criminal charges, and that will continue, the AG said.

Friday's announcements come amidst a continued crackdown on illegal immigration by President Donald Trump's administration and is the latest countermeasure by New Jersey Gov. Phil Murphy. Since taking office, Murphy has extended college financial aid to undocumented immigrants, created a state office to help immigrants and refugees resettle, and promised to grant driver's licenses to the undocumented, if the legislature approves.

But Murphy has also met resistance from from county officials who argue cooperation with ICE helps prevent criminals from being released back into the community.

The state's Immigrant Trust Directive allows any state, county, or local law enforcement agency to notify ICE of a detainee who has final orders of removal, or who has been charged with violent or serious offenses such as murder, rape, arson or assault. The updates announced by Grewal add other categories, including additional gun crimes and domestic violence offenses.

Sara Cullinane, director of Make the Road New Jersey, an immigrants-rights group, called the termination of the 287(g) programs "groundbreaking" but said expanding the list of offenses that would trigger a warning could cause more harm than good.

"We remain concerned that the criminal carve-outs of the Trust Directive, including those announced today, will continue to ensnare community members in the deportation system, causing particular harm to survivors of domestic violence who are occasionally inadvertently arrested when reporting domestic violence."

Humberto Cantero, a member of Make the Road New Jersey, said he was detained in Monmouth County after a traffic stop and held for a year away from his U.S.-born children thanks to the ICE program.

"When police and corrections officers are deputized to do the work of ICE it undermines the trust that we in the community have for our local law enforcement officers,'' he said. "By ending 287(g) programs in New Jersey, the Attorney General is making us all safer."