The NYPD detective who was killed by fellow officers during an attempted robbery in Queens last week was laid to rest on Wednesday, following a funeral that brought hundreds of mourners to the Church of St. Rosalie on Long Island.

Mayor Bill de Blasio delivered a eulogy, highlighting Detective Brian Simonsen's commitment to the Richmond Hill community he served for nearly two decades. "He had the ability to bring our officers and our community closer and closer together," the mayor said, adding that New Yorkers were "united right now in profound grief because we have lost such a good man."

Simonsen was killed last Monday while responding to reports of an armed robbery at a cellphone store on the corner of Atlantic Avenue and 120th Street. Six more officers arrived at the scene, firing 42 rounds after a suspect emerged from the storefront waving an imitation pistol, police said. Simonsen was killed by his fellow officers' bullets, and his partner Sgt. Matthew Gorman suffered a leg injury.

In his own remarks, Police Commissioner James O'Neill flatly rejected the possibility that the officers who shot Simonsen bore any responsibly for his death. "Those cops responded to a call for help. They didn’t hesitate and they are not to blame," he said. "The two people responsible for Brian’s death—the only two—are the career criminals who decided to go to that store on Tuesday night and commit an armed robbery."

(Mark Lennihan/AP/Shutterstock)

The primary suspect in the case, 27-year-old Christopher Ransom, was also shot by police. He's been charged with murder, aggravated manslaughter, robbery, assault and menacing, and is expected to be arraigned from his hospital bed. A second suspect, 25-year-old Jagger Freeman, allegedly served as a lookout for Ransom. He was arrested this weekend, and has been charged with murder, robbery, assault, and criminal possession of a weapon.

O'Neill also took issue with press coverage of the friendly-fire killing. Reports have noted that Ransom, who friends say is autistic, has been involved in several "eccentric" non-violent crimes, including impersonating a police officer and repeatedly sneaking into a Downtown Brooklyn courthouse, where he worked as an intern five years ago.

"I'd like to offer an alternate description of this 27-year-old felon: He’s a criminal. He’s a thief. And now he’s responsible for Brian’s death," O'Neill said.

(The NYPD is conducting an internal investigation into how the shooting unfolded. "We will learn every possible fact and try to draw every appropriate lesson," O'Neill said previously.)

In a press conference on Tuesday night, Ransom's attorney, Ken Finkelman, described the NYPD's "Kafkaesque, Soviet Union-type" treatment of his client. Ransom had been “overcharged and scapegoated,” Finkelman said, as a way to distract from the fact that police officers had violated procedures in Simonsen's death.

“The deceased detective seems like a great guy, a wonderful person," the attorney added. “I really have doubts that he would have wanted to see our client go away for the rest of his life pursuant to a homicide charge in these circumstances."