At least 200 uniformed NYPD officers formed ranks outside the Makki Masjid Muslim Community Center in Midwood, Brooklyn on Thursday to honor an officer who was shot and killed while off duty in a botched robbery attempt.

Adeed Fayaz, 26, was trying to buy a car from someone he met on social media in East New York when police say the person he met tried to rob him. The two struggled, and the man shot Fayaz, police said. The five-year veteran died late Tuesday evening.

Mayor Eric Adams and Police Commissioner Keechant Sewell both spoke at the funeral. Sewell said Fayaz would not only be mourned by his city, but also by his two young children, ages 3 and 4.

“This was a reprehensible taking of a police officer," Sewell said. "The violent robbery of a father from his family. This city needs its good fathers. His sons needed theirs."

Adeed Fayaz's mother watches pallbearers carry the casket to the hearse at the funeral of Adeed Fayaz at the Makki Masjid Muslim Community Center.

Outside, Muslim officers and members of the neighborhood's Muslim community gathered to offer prayers. Many cried when Fayaz’s coffin, draped in the NYPD flag, was carried out of the center by a ceremonial retinue and placed in a white hearse. His family followed close behind. Three NYPD helicopters flew over the procession.

Hundreds of police officers lined Coney Island Avenue for the funeral of Officer Adeed Fayaz.

“We lost a brother officer to a senseless act of violence. Something that we believe we are obligated to place ourselves in harm's way to prevent,” Adams said.

Randy Jones, 38, now faces murder charges in the case. A spokesman for the Legal Aid Society, which represents Jones, urged members of the public to avoid rushing to judgment in the case.