An Indian-American police officer, who has been on the job for just over six months, is being hailed a hero for rushing to neutralise a gunman who shot a police officer and wounded another.

Sumit Sulan, 27, shot the assailant who surprised the officers opening fire on them in his mother's flat on January 21 where police were called because of a domestic dispute.

Jason Rivera, 22, was killed and Wilbert Mora, 27, was wounded, but Sulan who was in the police party advanced and shot the alleged gunman, Lashawn McNeil, 47, according to police.

McNeil is in hospital with serious injuries.

Before taking on the gunman, Sulan had moved the mother and her other son to safety, police said.

Sulan and his two colleagues had gone to the flat in the Harlem neighbourhood in response to a call by McNeil's mother that her son was threatening her.

He had a close escape when he rushed to take on McNeil as the man allegedly was firing with a super-charged weapon - a modified Glock pistol fitted with a high-capacity drum with 50 rounds, turning it into a virtual machine gun.

His mother Dalvir Sulan told the New York Post: "I'm proud. Everyone (says) he did good."

She said that he was still struggling to deal with the events and "his brain is stuck on the situation".

According to her, the family had immigrated to the US about 15 years ago from India.

Sumit Sulan, who entered the police force only in April 2021, has been nicknamed "Super Rookie", according to the Post.

He had worked for the city as a taxi and limousine inspector before joining the police.

Sumit Sulan had responded earlier this month to a domestic violence incident during which a gun was seized, his police station tweeted with a picture of him holding the weapon.

In a city caught in a wave of escalating violence, Friday's incident was the third gun attack on police officers this month.

They are a direct challenge to Mayor Eric Adams, a former police captain, who took office on New Year's Day with a promise to crack down on crime.

He called the shooting of the police officers an "attack on the city".

Police have come under sustained attack around the country from the Democratic Party's left and its supporters with a sustained movement to either abolish or cut the police force in a campaign that started in May 2020 after the killing of an African-American by police in Minnesota.

While Adams, who is a Democrat, has pledged to take a hard line against crime, others in his party have taken the opposite tack.

His party colleague Avin Bragg, who was elected the public prosecutor for Manhattan, where the January 21 attack took place, has announced that he would not prosecute several categories of offences like most assaults; theft without guns that would affect Indian news-stand operators and Asian and Middle Eastern immigrants running grocery stores; not paying fares on the metro rail system, and resisting police, which in effect would decriminalising them.

So far the Black Lives Movement and the Democratic party's left have been silent on Sumit Sulan and have not attacked him for shooting McNeil, who is African-American, as they often do when a Black person is shot by police.

The slain officer and his wounded colleague are both Latinos, members of a minority community.