Detective Brian Simonsen of the NYPD was shot and killed Tuesday responding to a robbery in Queens. (Photo: NYPD)

Detective Brian Simonsen of the NYPD was shot and killed Tuesday responding to a robbery in Queens. (Photo: NYPD)

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 say.

The New York Post reports 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.

Sgt. Matthew Gorman was shot in the leg.

The suspected robber Christopher Ransom, 27, was brandishing what turned out to be a firearm replica and was shot by police.

“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,” O'Neill said.

The NYPD released the following statement from Commissioner O'Neill: "This evening at 6:10 p.m., two separate 911 callers reported a robbery in progress at a T-Mobile cell phone store located at 91-62 120th Street in Queens. The callers described the suspect as a male armed with a firearm. At least one of the callers said two employees of the store had been forced at gunpoint to the rear of the store.

"Detective Simonsen and his sergeant were in the area — working an unrelated case at the time — when they heard the call come over the radio. They did not hesitate. They responded immediately and pulled up as Patrol units arrived. Through the windows of the store, the officers did not see anyone inside. The officers then entered the store and immediately saw a man fitting the description of the suspect emerge from the back, pointing at them what appeared to be a handgun. With the suspect advancing toward them, the officers discharged their weapons and retreated out of the store. That was when Detective Simonsen was shot.

"His fellow officers put him in a marked police car and transported him [to a hospital], where the trauma staff did their best to try to save him. We thank them for that. They were unable to do so, however. The sergeant, who has 8 1/2 years with the NYPD, was shot one time in the leg. A passerby in a civilian vehicle stopped and helped him into the car and transported him [to the same hospital]. He is listed in stable condition."