A New York police detective responding to a reported armed robbery was killed by friendly fire at a cellphone store Tuesday night, the New York City police commissioner said.

A sergeant was also wounded in the shooting at a T-Mobile store in Queens. Police shot and took the subject into custody.

Authorities arrived at the scene around 6:10 p.m. after a 911 caller reported seeing the suspect force two employees to a back room at gunpoint, according to dispatch audio. A barrage of shots rang out minutes later. The sergeant told dispatchers he had been hit and another officer called for an ambulance for the detective.

Commissioner James O'Neill identified the detective as Brian Simonsen, 42, a 19-year-veteran of the department. The sergeant with non-life threatening wounds is Matthew Gorman, the union said.

Investigators look over the area after a few New York City police officers were shot while responding to a robbery at a T-Mobile store in the Queens borough of New York on Tuesday, Feb. 12, 2019.(Photo: Kevin Hagen, AP)

“Every day our men and women in uniform risk their lives to protect us, and tonight we are truly heartbroken to lose one of our own,” New York Attorney General Letitia James tweeted.