NEW YORK -- The New York Police Department is mourning a detective killed by friendly fire as officers confronted a robbery suspect who turned out to be armed with a replica handgun.

Detective Brian Simonsen, 42, was struck in the chest Tuesday night as multiple officers fired on the suspect at a T-Mobile store in Queens, police Commissioner James O'Neill said.

Simonsen, a 19-year NYPD veteran, was put in a squad car and taken to a hospital, where he was pronounced dead.

"This appears to be an absolutely tragic case of friendly fire," an emotional O'Neill said. "Make no mistake about it, friendly fire aside, it is because of the actions of the suspect that Detective Simonsen is dead."

Another officer, Sgt. Matthew Gorman, was shot in the leg, during the chaotic scene. A passerby stopped and drove him to a hospital, where he was in stable condition.

The robbery suspect, a 27-year-old man with an extensive criminal record, was armed with an imitation firearm, O'Neill said. He was wounded and is hospitalized in stable condition.

A police official identified him Wednesday as Christopher Ramson of Brooklyn. The official was not authorized to discuss the case publicly and therefore spoke to The Associated Press on condition of anonymity.

Police swarmed to the store at around 6:10 p.m. after a 911 caller standing outside reported seeing the suspect -- dressed in all black and carrying a duffel bag -- take two employees to a back room at gunpoint, according to dramatic dispatch audio.

"No sirens, guys," a dispatcher warns.

Simonsen and Gorman, who were both in plainclothes, were working on another case nearby when the call came over and arrived around the same time as patrol officers, O'Neill said. At first, the front of the store appeared empty, he said.

Then a man matching the suspect's description emerged from the rear of the store pointing at them what appeared to be handgun and police started shooting, he said.

"Shots fired! Shots fired!" an officer is heard yelling on the dispatch audio over a barrage of gunshots.

About a minute later, Gorman tells dispatchers that he's been hit and an officer screams for dispatchers to rush an ambulance to the scene.

Arwindern Singh, who lives across the street from the store, said he heard about 20 shots go off and thought they were firecrackers.

When he went outside, he said, "all of a sudden there were cops all over."

The gunfire blew out the store's doors, showering the sidewalk with glass. Bullet holes pocked frosted windows that were decorated with the T-Mobile logo. Scores of police officers streamed to the scene, which was roped off with crime tape. Some walked together in a line, searching for evidence.

At Jamaica Hospital, officers guarded the emergency room entrance as O'Neill and Mayor Bill de Blasio met with Gorman and offered their condolences to Simonsen's wife and mother.

"It was heartbreaking. Absolutely heartbreaking," De Blasio said. "His mom, who has suffered so much. His wife. The shock that they're feeling was so painful to see."

Simonsen should've been off Tuesday for a union meeting, but he opted to go to work so he could continue tracking a string of recent robberies, Detectives' Endowment Association president Michael Palladino said.

De Blasio praised the officers for rushing into dangerous situations and taking decisive action when lives are threatened.

"They know it's a moment where they cannot hesitate, where even a moment of hesitation can mean a life is lost," De Blasio said. "That bravery and that resolve is something that we all need to understand."

----

Balsamo reported from Washington. AP reporter Tom McElroy contributed to this report