Federal authorities are investigating the shooting of a man in New York City that involved a US Immigration and Customs Enforcement officer, a case that is inflaming passions around the city's sanctuary policies.

The shooting happened around 8:15am (13:15 GMT) on Thursday in the Bensonhurst neighbourhood of Brooklyn. Federal authorities were trying to arrest Gasper Avendano-Hernandez, a Mexican man accused of being in the country without documents.

ICE said two of its officers were "physically attacked" during the arrest and taken to hospital. At least one of the officers opened fire during the confrontation, striking another man accused of interfering with Avendano-Hernandez's arrest.

More:

That man, whose name was not released, received injuries that were not considered life-threatening, authorities said. It was not clear whether he was armed.

ICE released a statement saying New York City police arrested Avendano-Hernandez on Monday on a felony charge of possessing a forged instrument.

Federal authorities "attempted to lodge an immigration detainer" for his deportation, but he was released from custody, ICE said in its statement.

"This forced ICE officers to locate him on the streets of New York rather than in the safe confines of a jail," ICE said.

The shooting comes amid an escalating dispute between the administration of President Donald Trump and New York City over its sanctuary policies. ICE has expressed frustration in recent weeks that the city does not honour the vast majority of its detainer requests.

New York Mayor Bill de Blasio addressing the New Hampshire Democratic Party state convention in Manchester, New Hampshire, US [File: Gretchen Ertl/Reuters]

Mayor Bill de Blasio's administration has said it complies with detainer requests for defendants only after they are convicted of a violent or serious felony. The city does not turn over defendants awaiting trial.

The mayor's office did not immediately respond to a request for comment.

The Trump administration on Thursday temporarily barred New Yorkers from several programmes that allow faster security checks when they enter the US, widening the dispute over the New York state law limiting cooperation with federal immigration enforcement.

The US Department of Homeland Security (DHS) said the action, which took effect on Wednesday, would bar both new passes and renewals and would not apply to Transportation Security Administration pre-checks.

Acting Deputy Secretary Ken Cuccinelli told reporters the state's lack of security cooperation with federal immigration authorities necessitated the suspension of such travel programmes as one known as Global Entry.

Ken Cuccinelli, acting director of US Citizenship and Immigration Services, speaking to the news media at the White House in Washington, US [Leah Millis/Reuters]

He assailed the state about a law passed last year limiting the information the New York State Department of Motor Vehicles, which issues driver's licences, could share with federal immigration authorities.

Trump has made his immigration crackdown a focus of his 2020 re-election campaign. The president criticised so-called "sanctuary" jurisdictions during his annual State of the Union speech on Tuesday night.

New York Governor Andrew Cuomo's senior adviser, Rich Azzopardi, said it was "obviously political retaliation" and that the governor's office was studying its legal options.

The suspension also will apply to programmes that allow for expedited travel between the US, Canada and Mexico, including a programme for commercial truck drivers.

The DHS estimated that the suspension could affect between 150,000 to 200,000 New York residents who attempt to renew membership in the travel programmes if the ban remains in place through the end of the fiscal year, which runs to September 30.