A New York City police detective killed by friendly fire while responding to a chaotic robbery scene was hailed at his funeral on Wednesday as a consummate law enforcer with people skills befitting his lifelong nickname: "Smiles."

Brian Simonsen , whose posthumous promotion to detective first grade prompted a lengthy standing ovation in a crowded Long Island church, was shot in the chest on Feb. 12 outside of a cellphone store in Queens.

He and six other officers opened fire on a robbery suspect who police say was pointing what appeared to be a handgun. Simonsen's partner, Sgt. Matthew Gorman , was hit in the leg and arrived at the funeral in a wheelchair.

"The only two people responsible for Brian's death, the only two, are the career criminals" involved in the robbery, Police Commissioner James O'Neill said firmly, delivering a eulogy in a voice sometimes choked with emotion.

To the devastated men and women of the 102nd Precinct, where Simonsen worked, and to officers around the city, O'Neill said: "Thank you for your dedication."

"Always remember who you are, what you do and why you do it," he said. "Continue to be proud of that" while honoring Simonsen's legacy.

In his 19-year career, Simonsen made nearly 600 arrests, most of them for felonies. "He was exceedingly good at his job," said O'Neill, "making connections with the evidence" and also reconnecting crime victims "with the hope that was stolen from them."

On the night he was shot, Simonsen should have been off for a union meeting. But he opted to go to work so he could continue tracking a string of recent robberies.

"It was never just a job for him," said Mayor Bill de Blasio.

The mayor related a story about Simonsen soothing a crime victim who'd fought off an intruder. She cried on his shoulder so long that his shirt was soaked with her tears.

On Wednesday, the tears of many were evident at the Roman Catholic Church of St. Rosalie in Hampton Bays.

Simonsen and his wife, Leanne, a nurse, lived in Calverton, near the Long Island community where he grew up. Neighborhood kids knew him as "Uncle Brian."

"Smiles, he should have been the mayor. He was the glue. ... He just loved everyone," said Melissa Weir, who had known him since high school.

"There's a lot of people who are hurting," Weir said outside the church. "Last night, I screamed in my car."

"You don't want any of our police to end up that way. But why him? ... A good guy, such a larger-than-life personality," she said. "A stand-up guy."