The man who was shot was black and the officer who did the shooting is Hispanic, a spokesman for the New York Police Department said.
Several recent police killings of unarmed African-American men, and grand jury decisions not to indict the police officers involved, have triggered racially tinged protests over police use of force.
Police went to the world headquarters of the Chabad-Lubavitch movement about 1:40 a.m. EST (0640 GMT) and found the 49-year-old suspect with the knife in hand, the New York Police Department said in a statement.
“According to witnesses (the attacker) was heard saying repeatedly, ‘Kill the Jews,’ ” Rabbi Motti Seligson of Chabad-Lubavitch said in the statement.
When police officers confronted him, the man complied with their demand to drop the knife, but he picked it back up and began moving toward them. The officer shot once, hitting him in the torso. The man was taken to a hospital where he was pronounced dead.
Victim in stable condition
Chabad-Lubavitch identified the stabbing victim as Levi Rosenblat, 22, who was studying in the synagogue when he was attacked. He was stabbed in the left temple and was in stable condition at the same hospital where his attacker died, police said.
In a video of the confrontation, the attacker walks up to and asks each of about a half-dozen men dressed in Orthodox Jewish clothing, “Want me to kill you?”
The officer demands the attacker drop the knife or he will shoot and the men initially shout, “Don’t shoot! Don’t shoot!”
Police confirmed the video, which was posted to the New York Post website, was legitimate.
The knife was recovered at the scene and the investigation into the incident is continuing.