NEW YORK – An NYPD detective was killed and a fellow officer wounded by friendly fire as they responded to the scene of a robbery in Queens Tuesday night, police said. 

Detective Brian Simonsen, 42, a 19-year veteran, was fatally shot by a fellow officer in a ­T-Mobile store at Atlantic Avenue and 121st Street in Richmond Hill at about 6 p.m. reported the New York Post.

“At this hour, I will tell you that this appears to be an absolutely tragic case of friendly fire. … Make no mistake about it, friendly fire aside, it is because of the actions of the suspect that Detective Simonsen is dead.”

– Police Commissioner James O’Neill

Moreover, Sgt. Matthew Gorman was struck in the leg, according to police.

The robbery suspect, Christopher Ransom, 27, was brandishing an replica firearm. As a result, police shot him.

“At this hour, I will tell you that this appears to be an absolutely tragic case of friendly fire,” Police Commissioner James O’Neill said at a press conference.

“Make no mistake about it, friendly fire aside, it is because of the actions of the suspect that Detective Simonsen is dead.”

Ransom, who has a lengthy rap sheet, had been suspected in a series of area robberies, sources said.

NYPD detective

NYPD says this is Christopher Ransom, who had been suspected in other area robberies. (DCPI)

Consequently, Ransom was in serious condition Tuesday night at New York Presbyterian/Queens hospital.

Simonsen and Gorman entered the store and saw Ransom in the back pointing what turned out to be the fake gun at them, O’Neill said.

Therefore, as the officers turned to retreat to safety, additional responding officers shot them.

A police source said eight officers fired a total of 40 rounds.

Simonsen was hit in the chest and was rushed to Jamaica Hospital Medical Center in an NYPD squad car, O’Neill said.

A civilian driver pulled over when he saw what was going on and rushed Gorman to the same hospital.

Mayor Bill de Blasio said both he and O’Neill had met with Simonsen’s wife and mother.

“This is a very difficult and painful night for our city. We lost a very good man,” de Blasio said.

“Commissioner ONeill and I just spent time with Detective Simonsen’s family. And it was heartbreaking, just heartbreaking. The shock that they’re feeling is so painful to see.

“And we told the Simonsen family that the New York City Police Department will be with them. New York City will be with them. As long as they live, we will support them. And it’s some small comfort to them in this moment of agony.”

A passer-by near the T-Mobile store told the Post he ducked behind a tree as the shots rang out.

“I think the suspect shot first. Then the police started opening fire,” said Jason Parodi, 21, unaware the suspect’s gun was fake. “At least 11, 12 shots I heard.”

“Then, out of nowhere, I see mad cop cars coming. They barricaded the whole T-Mobile. They went inside, guns out. They got the suspect out.

“Actually, I think I saw one officer. He was shot. He was limping to his car. I was scared, I didn’t know what direction the bullets were coming in, so I hid behind that tree by the park.”