By Ellen Wulfhorst

NEW YORK (Reuters) - Two men were under arrest on Tuesday in the shooting of two New York plainclothes police officers who were fired upon while responding to an armed robbery, authorities said.

The officers' injuries were not life-threatening, and they were in stable condition, New York Police Commissioner William Bratton said at a news conference.

The incident follows the fatal shooting of two uniformed officers in Brooklyn as they sat in their squad car just days before Christmas by a gunman who had made threats against police on social media.

In this week's shooting, police did not appear to have been targeted. The officers were responding to a robbery at a deli in the city's Bronx borough, police said.

The shooting comes amid controversy over whether New York police have launched a deliberate work slowdown as part of the their dissatisfaction with Mayor Bill de Blasio.

Some police say that de Blasio's support for protests over the killings by white police of unarmed black men in New York and Missouri showed a lack of respect.

The head of the city's police union said that Monday's shooting was evidence that there was no such slowdown.

"New York City police officers, who could have closed their lockers and gone home after their shift ended, chose to respond to a robbery in progress and, sadly, were shot in the process," said Patrick Lynch, the president of the Patrolmen's Benevolent Association.

Five officers who were just ending their shifts responded to the robbery, Bratton said.

Officer Andrew Dossi, 30, and Officer Aliro Pellerano, 38, were shot as they approached two masked suspects, he said.

The officers fired back, and one suspect was wounded in the arm, according to Chief of Detectives Robert Boyce.

The suspects fled, and one of them carjacked a sports car that was later abandoned.

One suspect, Jason Polanco, was arrested in the Bronx on Tuesday, and the other, Joshua Kemp, was arrested when he sought hospital treatment for a gunshot wound, Boyce said.

Story continues

The two are believed responsible for other local commercial robberies, Boyce said. One of them has made anti-government and anti-police statements on Instagram, Boyce said.

Polanco faces charges of attempted murder of police officers along with charges of robbery and carjacking. Kemp was charged with commercial robbery, Boyce said.

Police lauded the officers for their response.

"They were going home, they jumped into a car and they ended up getting into this fierce firefight," said NYPD Chief of Department James O'Neill.

(Additional reporting by Curtis Skinner in San Francisco and Jonathan Allen in New York; Editing by Jeffrey Benkoe and Leslie Adler)