Christopher Ransom is accused of brandishing an imitation gun at...

Christopher Ransom is accused of brandishing an imitation gun at NYPD officers during the alleged robbery. Credit: @NYPDChiefofDept / Twitter

The Brooklyn man whose stickup police said sparked the mistaken shooting and killing of an NYPD detective by fellow officers had once run into a local precinct while impersonating a cop, the department said Wednesday. 

On Tuesday evening inside a T-Mobile cellphone store in Queens, the man — later identified as Christopher Ransom, 27 — was running toward officers and brandishing what turned out to be a fake gun, leading seven officers responding to the robbery call to fire 42 shots, striking a sergeant and killing the detective, Brian Simonsen, according to NYPD Chief of Department Terence Monahan.

Ransom, who was shot multiple times by police, has been charged with murder, robbery, assault, aggravated manslaughter and menacing, the NYPD said Wednesday. He remained hospitalized at NewYork-Presbyterian Queens hospital in Flushing.   

Before Tuesday’s robbery, a man later identified as Ransom was seen outside the T-Mobile store with a mask and the firearm, which turned out to be fake, and a witness called 911 — a call that sent Simonsen, among other officers, to the scene, said Kevin Maloney, commander of the NYPD's Force Investigation Division. 

Ransom has four misdemeanor convictions, the most recent in November 2016, when he pleaded guilty to criminal trespass for the cop impersonation. He had tried to enter the Crown Heights-based 77th Precinct with a fake badge, according to a law-enforcement source who asked not to be named. He was sentenced to 20 days.

He also pleaded guilty, in 2015, to petit larceny and was sentenced to 30 days for the theft of handbags, and in 2013 pleaded guilty to criminal trespass in connection to stalking judges, the source said.  

Video with Ransom’s name and likeness shows him going to a police precinct insisting he's a superhero and wearing only an ersatz cape and underwear. The date of that video is unclear. There is also a photograph showing the man wearing an FBI jacket on social media. Ransom also filed a lawsuit he filed alleging that he had been falsely arrested in Brooklyn. 

Det. Brian Simonsen, 42, of the 102nd Precinct, was critically wounded while responding to a robbery in Richmond Hill, Police Commissioner James O'Neill said. Credit: Twitter / Citizen NYC; Todd Maisel; John Roca

An NYPD spokesman who spoke on the condition that his name not be published said that the NYPD could not positively say it is Ransom in the video, or images on Facebook where he is dressed up in cop and FBI garb.

With Anthony M. DeStefano

Get the latest news and more great videos at NewsdayTV Credit: Newsday

Ex-workers accuse town zoo of neglect toward animals ... 'Christmas Vacation' lights ... Get the latest news and more great videos at NewsdayTV

Get the latest news and more great videos at NewsdayTV Credit: Newsday

Ex-workers accuse town zoo of neglect toward animals ... 'Christmas Vacation' lights ... Get the latest news and more great videos at NewsdayTV