(CNN) A New York Police Department detective was shot and killed Tuesday, and a sergeant was hit in the leg, after they responded to a reported robbery at a cell phone store in the borough of Queens, city officials said.

It was an apparent incident of friendly fire, Police Commissioner James P. O'Neill said. As the two officers went into the store, a suspect came out of a back room with a replica handgun. The detective and sergeant fired, and as they were leaving the store, the detective was apparently shot by uniformed officers.

"Once again our hearts are broken in the NYPD," O'Neill said.

Brian Simonsen, 42, and a 19-year veteran of the department, was killed, police said.

Detective Brian Simonsen was shot and killed while responding to a reported robbery at a cell phone store in Queens, New York.

O'Neill and Mayor Bill de Blasio met with Simonsen's family at a hospital.

Read More