The shooting happened a block away from New York's Penn Station and famed Madison Square Garden. One officer had a Taser out.
The officers suffered a head injuries and were transported to the hospital in unknown conditions.
The worker said the assailant struck the officer with the knife when he tried to disarm him.
Thompson was a self-radicalized "lone wolf terrorist", police officials said after the attack.
A witness said he heard multiple gunshots. "I saw everybody running and police running".
Other witnesses said workers leaving their offices ran for cover. The man refused and got into an altercation with the officers.
"They shot until the threat was stopped, " said O'Neill, who is succeeding Bratton as commissioner.
Cory Melton was at 32nd Street and 7th Avenue checking his phone when he heard shots.
Photos he took show a gray, four-door sedan with bullet holes in the windshield and numerous police cars with their emergency lights on.
Two law enforcement officials identified the suspect as 32-year-old Akram Joudah of Queens, who's been arrested 15 times in the past. It is likely to be many hours, if not days, before a lawyer is appointed to represent him.