Detectives Rafael Ramos and Wenjian Liu were fatally shot while sitting in their patrol car in Bedford-Stuyvesant last December.
Mayor Bill de Blasio, Police Commissioner William Bratton and the officers' families gathered for the dedication of a plaque at the 84th Precinct, where the officers worked.
"Because of the uniform they wore, because of the badge they wore, it was therefore not only an attack on these two good and brave men, but an attack on all of us," said de Blasio. "An attack on everything we value and everything we hold dear."
Liu's father, Wei Tang Liu, thanked everyone for their support in a ceremony attended by hundreds of officers.
He bent over in grief and sobbing as he spoke in Chinese about his only child.
Liu's wife, Sandy Liu, translated, breaking down as she spoke her father-in-law's words: "Before my son's death, I would hear his voice every day for the past 33 years of his life."
There was also a wreath-laying ceremony and a moment of silence at the scene of the shootings in Brooklyn.
Recently the widow of Detective Ramos, Maritza, annnounced that she is launching the Detective Rafael Ramos Foundation with the hope of bettering relations between police and minority communities.
Ramos and Liu were on duty in their marked patrol car in Bedford-Stuyvesant near Tompkins and Myrtle Avenues when both were shot in the head.
After the officers' deaths, the gunman, Ismaaiyl Brinsley killed himself. Police said he was troubled and had shot and wounded an ex-girlfriend in Baltimore earlier that day.
Money raised to pay off mortgages for families of 2 slain NYPD officers
Detective Rafael Ramos's widow starts foundation, doesn't want husband to be forgotten
(The Associated Press contributed to this report.)