A bystander, a woman, suffered a graze wound in her arm. An officer also was injured, and both were taken to a hospital.
New York City Police Department Chief James O'Neill said the 46-year-old man became "aggressive and belligerent" inside a Food Emporium at about 8:20 a.m., swearing at people in the store while he tried to buy beer and fighting with the cashier. An officer on foot patrol responded, brought the man outside and they fought on the street, tumbling to the ground just a few hundred feet from Broadway theaters showing "Wicked" and "The Book of Mormon."
The man got up and pulled out the knife as other officers arrived, O'Neill said.
"The officers ordered the suspect to drop the knife, and he continued to approach them with a knife in his hand," O'Neill said.
A sergeant and the officer who initially responded fired a total of nine shots, police said.
The man's name wasn't immediately released, and it wasn't clear whether he had a history of mental illness or a criminal record.
O'Neill said the investigation was continuing. Police were looking at surveillance video and were interviewing witnesses.
The suspect struggled with an officer, falling to the ground. As the suspect got back up he displayed a knife pic.twitter.com/PmuS9l5zS1— NYPD NEWS (@NYPDnews) May 18, 2016
Sharona Shriver, who lives in an apartment building nearby, said she was doing her makeup when she heard the shots and ran to the window. She saw the dead man surrounded by police.
"He was face down with blood pouring out of his head. Looked like it was coming out of his head or upper body," she said. "A trail of blood."
Her roommate, Tamar Mendelsohn, said she heard about six shots, and when she looked out the window she saw the officer crying. She didn't see a knife.
A Hilton Garden Inn stands at the corner of Eighth and 49th streets where the shooting occurred. The area was blocked off. Some guests whose windows overlook the shooting scene were taking cellphone photos of the body under the cloth.
Associated Press writer Kiley Armstrong contributed to this report.