(NEW YORK) — Grieving officers of the New York Police Department gathered Wednesday at an emotional funeral for Detective Brian Simonsen who was killed by friendly fire while responding to a robbery last week.

Simonsen, 42, and his partner “made the decision to move toward the danger” at a Queens T-Mobile store on Feb. 12, Police Commissioner James O’Neill told the mourners at Wednesday’s funeral. “They did so because people needed them. They did so because they make tough decisions others are unable or unwilling to make. They did so because they are NYPD cops.”

Simonsen, a detective, was “exceedingly good at his job,” O’Neill said.

“After these crimes, victims who were once confident find themselves suddenly afraid. There is a loss of trust, a loss of belief in their fellow human beings,” he said. “But Brian was always able to walk into the most chaotic of situations and calm things down – really communicate and reach people.”

“Being an NYPD cop is what Brian dedicated his life to for 18 years, 11 months and 12 days,” spending his entire career at the 102nd Precinct, O’Neill said.

Today we say our final goodbyes to #NYPD Det. Brian Simonsen, killed in the line of duty last week. Whether it was as a police academy recruit (in this 2000 photo) or as a seasoned investigator, Brian was always the one you wanted next to you when decisions mattered the most. RIP pic.twitter.com/2RHwhJmXtk

Simonsen is survived by his mother, Linda, and his wife, Leanne, a nurse.

Simonsen “faced several heartaches as a teenager” when his dad and sister died months apart, said his cousin and fellow NYPD officer Sean Peterson. But Simonsen immediately became a “rock” to support his family, said Peterson.

After meeting his wife, a Chicago native, in Las Vegas, “Brian knew he had found the one,” said Peterson, and she became the “missing piece of the puzzle that completed Brian’s life.”

“To Leanne and Linda, and to all of Brian’s loved ones, know this: Our family is your family,” O’Neill said.

To the officers gathered in the pews, O’Neill urged them to never “forget why you chose to become police officers … never forget that Brian lived to protect all New Yorkers, and his legacy protects us still.”

Simonsen was his precinct’s union delegate and attended a union meeting on the day of his death, authorities said. He decided to respond to the call in Queens even though he didn’t have to, authorities said.

In a chaotic scene at the T-Mobile store that unfolded within seconds, seven officers shot 42 rounds, authorities said. The officer who responded with Simonsen was shot and injured.

Two suspects are in custody. The suspects’ weapon was an imitation gun, authorities said.

Detective Brian Simonsen represented what it means to be a great cop — to go beyond the call of duty. Today, we mourn the loss of a hero who went in harm’s way & celebrate a life dedicated to service. We’ll forever be indebted to Brian & his family. The NYPD will #NeverForget. pic.twitter.com/s5ixEDP1Zo

“All of the police officers at that tragic shooting will carry their grief with them for the rest of their lives,” O’Neill said, adding, “Those cops responded to a call for help. They did not hesitate. And they are not to blame.”

“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,” O’Neill said, his voice shaking.

New York City Mayor Bill de Blasio also spoke at the emotional service.

“I hope all New Yorkers and all Americans look at this example … of all the goodness that a police officer can bring to a community,” he said.

“Even after this tragedy Brian kept giving back, still taking care of others. He wanted to be an organ donor to make sure he could continue to save lives and he did,” the mayor said.

He continued, “We have lost one of our very best. We will never forget him.”