A New York City Police Department officer who was shot while off-duty during an attempted robbery in Brooklyn over the weekend has died from his injuries, authorities said Tuesday. A suspect, identified as Randy Jones, has been arrested, police said.

Adeed Fayaz, 26, died at a Brooklyn hospital, NYPD Commissioner Keechant Sewell announced Tuesday night. He had been in critical condition since Saturday’s shooting.

Fayaz was a five-year veteran of the department and leaves behind a wife and children, police said.

Fayaz was shot after arranging a meeting through Facebook Marketplace to potentially buy a Honda Pilot for $24,000, NYPD Chief of Detectives James Essig said at a news conference Tuesday.

“At the location, they were met by a male wearing a black jacket, gray sweatpants with a bearded mustache,” Essig told reporters.

The suspect asked “jokingly,” if the two men were armed, and when they responded no, he grabbed Fayaz, put him in a headlock and pointed a gun at Fayaz’s head and demanded money, Essig said. When Fayaz responded that he didn’t have any money, the suspect pointed the gun at Fayaz’s brother-in-law, Essig said.

Fayaz broke free from the headlock, at which point the suspect shot Fayaz in the head, and “continued to fire at both the officer and his brother-in-law” while fleeing, Essig said.

Fayaz’s brother-in-law pulled a gun that had been holstered on Fayaz’s “hip” and returned fire at least six times as the suspect jumped into a car and sped away, Essig said.

Investigators were able to identify the fleeing vehicle as a 2011 BMW registered to Jones’ mother, Essig said.

On Monday, police found and arrested Jones in a Days Inn motel room in Nanuet, New York, Essig said. Also in the motel room was Jones’ girlfriend, along with five children between six months and 11 years of age, Essig added.

Charges against Jones, who has a criminal history, are pending, Essig said.