Officers salute a procession as the remains of slain Detective Brian Simonsen are removed from Jamaica Hospital Tuesday, Feb. 12, 2019, in the Queens borough of New York. A NYPD detective and a NYPD sergeant were shot while responding to an armed robbery at a T-Mobile store in Queens. (Kevin Hagen/Associated Press)

NEW YORK — The robbery suspect targeted in a hail of police gunfire that killed a New York City detective Tuesday night has a long rap sheet and a history of bizzare pranks ready-made for his social media pages.

Christopher Ransom, 27, once faked his way into a police station and a judge’s chambers and has loaded up his Facebook and YouTube pages with videos of himself masquerading as a Speedo-wearing superhero.

After one arrest, court papers show, Ransom was taken to a psychiatric ward.

Detective Brian Simonsen died after being struck once in the chest as he and six other officers fired at Ransom, who charged toward the entrance of a T-Mobile store in Queens while simulating pulling the trigger of his fake handgun, police said.

The officers fired a total of 42 times, NYPD Chief of Department Terence Monahan said.

Simonsen’s supervisor, Sgt. Matthew Gorman, was shot in the leg and is in stable condition. Ransom was wounded and is hospitalized in stable condition.

The shooting started as Gorman and two uniformed officers retreated from the store when Ransom emerged from a back room and came at them, Chief of Department Terence Monahan said.

“You have to understand, this happens in seconds,” Monahan said. “It goes from 0 to 60. You’re investigating a possible crime and all of a sudden someone is charging at you, pointing what you believe to be a firearm, simulating firing at you. It raises everything very quickly.”

Simonsen stayed outside as Gorman and the uniformed officers went in, Monahan said. Simonsen fired two of the 42 shots. Gorman fired 11 times. It’s not clear who fired the shots that struck them, Monahan said.

The gunshots blew out the store’s doors, showering the sidewalk with glass.

Five officers captured parts of the scene on body cameras, Force Investigation Division Chief Kevin Maloney said. Investigators are also reviewing surveillance footage from the store.

Ransom has been arrested at least 11 times since 2012, records show, and he was wanted by police in connection with a Jan. 19 robbery at another cellphone store.

Ransom was charged in 2016 with impersonating a police officer after allegedly climbing over a gate and walking up to a desk at a Brooklyn police station while wearing a fake SWAT vest and police badge.

Police records list his alias as “Detective.” Ransom pleaded guilty to criminal trespass and was sentenced to 20 days in jail.

Four years earlier, he pleaded guilty and was sentenced to jail time for pretending to be an intern to gain access to a judge’s chambers.

On social media, Ransom has styled himself as a comedian and prankster in the vein of Sasha Baron Cohen of “Borat” fame, posting videos of stunts that sometimes veered into dangerous territory.

In one video, he’s shown in his cape-and-Speedo superhero outfit stopping a subway train by jumping on the tracks and putting his hand up. In another video, he shows up to a police precinct in the outfit.

Ransom sued the city over a 2015 arrest, alleging officers approached him on a Brooklyn street corner for no reason, cornered him in a food store with guns drawn and took him to a psychiatric ward against his will.

Ransom’s charges were later dismissed, and he dropped the lawsuit in 2016.

A message was left for Ransom’s lawyer in the lawsuit.

Simonsen, 42, grew up on Long Island, and he and his wife continued to live close by - more than an hour’s drive from the 102nd precinct where he worked his whole 19-year NYPD career.

Since childhood he’s been known as “Smiles” for his bright, welcoming personality. At Riverhead High School, he played football and baseball and was friends with everyone he met, childhood friend Melissa Weir said.

“Everyone is in complete shock. Everyone is feeling this,” Weir said. “When you have somebody like Brian, it’s really hitting everybody. There are people all over the place hurting.”

Simonsen should have 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.

Police swarmed to the T-Mobile store at around 6:10 p.m. Tuesday after a 911 caller standing outside reported seeing a man take two employees to a back room at gunpoint, Monahan said.

Simonsen and Gorman, who were both in plainclothes, were working on another case nearby when the call came and arrived around the same time as patrol officers, police said.

__

Follow Michael Sisak at twitter.com/mikesisak

Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.