As New York City mourned the death of NYPD Officer Adeed Fayaz at his funeral Thursday, just days after he was shot in the head during a robber while off-duty, the 26-year-old officer was remembered not just as a guardian of the city, but as a husband and father.

Hundreds of NYPD officers gathered at the Makki Masjid Muslim Community Center in Brooklyn to pay their final respects to the fallen 26-year-old officer.

"Not only was he a police officer but he was a dad," Mayor Eric Adams said, adding that Fayaz was "a symbol of what is great about this country."

NYPD Commissioner Keechant Sewell said that Fayaz’s two sons, ages 4 and 3, were his greatest joys and achievement.

NEW YORK OFF-DUTY COP SHOT DURING ATTEMPTED ROBBERY DIES

Officer Adeed Fayaz

NYPD Officer Adeed Fayaz was off-duty when he was shot in the head on Saturday during a botched robbery. He died Tuesday. (New York City Police Department)

"Raising two sons with Madiha, serving in a position he loved in the 66 Precinct and building a career, he was pouring the foundation of a life well lived," Sewell said.

Fayaz, born in Pakistan, came to the U.S. when he was five years old and decided to become a police officer during middle school, Sewell said. 

NYPD police office crying outside mosque

NYPD officers gathered outside the at the Makki Masjid Muslim Community Center in Brooklyn to pay their final respects to the fallen 26-year-old officer. (NYPD)

He wanted one day to lead his own unit, to continue to serve and "to shape the next generation of protectors," the commissioner said.

"His colleagues would tell you that his enthusiasm was legendary, his generosity was limitless," Sewell said. "That he would give you the shirt off his back or lend you the extra pants he always kept in his locker. They will tell you he learned and studied with passion, and he was well on his way to make sergeant."

police officers saluting outside mosque for funeral

Fayaz was remembered by his colleagues for his "legendary enthusiasm" and generosity, NYPD Commissioner Keechant Sewell said at the funeral for the fallen officer. (NYPD)

Fayaz was shot Saturday in Brooklyn, where he and his brother-in-law went to buy a car posted on Facebook Marketplace from 38-year-old Randy Jones, the man later identified as the alleged shooter, for $24,000, authorities said.

NEW YORK OFF-DUTY COP SHOOTING SUSPECT CAPTURED USING WOUNDED OFFICER'S HANDCUFFS

When Fayaz and his brother-in-law arrived, Jones asked "jokingly" if the men were armed, according to authorities. Jones then allegedly put Fayaz in a headlock and demanded the money.

sea of officers standing outside mosque

A sea of NYPD officers gathered for the funeral of Fayaz on Thursday. (FOX5 WNYW)

Fayaz said he didn't have the money, according to officials, and Jones pointed a gun at Fayaz's brother-in-law. Fayaz broke free from the headlock and Jones shot him in the head, police said.

officers outside funeral

Fayaz was remembered not only as a police officer, but also as a husband and father to two young sons. (FOX5 WNYW)

Jones was arrested at a suburban motel Monday in connection with the shooting. Police detained Jones using Fayaz's handcuffs. 

CLICK TO GET THE FOX NEWS APP

Tuesday night, authorities announced Jones was charged with murder and attempted robbery.

The Associated Press contributed to this report.