The shooting happened on Monday afternoon when two officers responded to a report of a person with a weapon.
Police said the officers opened fire when the man, identified as Walter Wallace, “advanced towards” them. An investigation has been opened.
Hundreds took to the streets to protest against the shooting.
The protests, which began late on Monday and continued into the early hours of Tuesday, turned violent at times, the Philadelphia Inquirer newspaper reported.
Images from the scene showed a police vehicle set on fire. There were also reports of looting.
Some 30 officers were injured, most of them from being struck by objects such as bricks and stones, according to preliminary information from police cited by the Associated Press (AP) news agency.
One officer was in hospital with a broken leg and other injuries after being struck by a pickup truck, police said.
More than a dozen people were arrested, police said.
Large protests broke out in Philadelphia earlier this year following the police killing of 46-year-old African-American man George Floyd in Minnesota. Footage showed white police officer Derek Chauvin kneeling on Floyd’s neck, while he repeatedly said he was unable to breathe.
Floyd’s death sparked protests around the world against racism and police brutality.
What do we know about the shooting?
Police said the shooting happened at about 16:00 (20:00 GMT) on Monday, when two officers responded to a report of a man with a weapon in the neighbourhood of Cobbs Creek in West Philadelphia.
Police spokeswoman Tanya Little told AP that a man, later identified as Mr Wallace, was holding a knife when the officers approached, and instead of following orders to drop the weapon “advanced towards them”.
Both officers then fired “several times”, hitting Mr Wallace in the shoulder and chest.
One of the officers drove him to a hospital, where he was pronounced dead a short time later, she said.
Video footage shared on social media shows two officers pointing their guns at Mr Wallace as he walks towards them. The officers back away from him and shout at him to put the knife down.
Shots are then fired and Mr Wallace is seen lying on the street.
The identities of the two police officers have not been made public.
In a statement, Philadelphia Mayor Jim Kenney said the “tragic incident… presents difficult questions that must be answered”.
He said a “full investigation” would be conducted.
“I look forward to a speedy and transparent resolution for the sake of Mr Wallace, his family, the officers and for Philadelphia,” he added.