Some witnesses said the man had been armed with a machete. One described him as wearing silver canisters on his chest.
Police said the man they had shot had been pronounced dead.
The London ambulance service said three people were wounded and had been taken to hospital after the attack in Streatham, a residential district south of the River Thames. It was not clear if all three suffered stab wounds.
Police said the scene of the incident was now fully contained. “The circumstances are being assessed; the incident has been declared as terrorist-related,” the police said on Twitter.
They said one of the wounded was in a life-threatening condition.
A Western security source said the incident was related to Islamist militancy. Another security source said it was being treated as terrorism as the man was thought to have been wearing a fake explosive device.
Police were still looking into whether he had been under surveillance by security services, the source said.
The local member of parliament, Bell Ribeiro-Addy, said one of the wounded was seriously hurt.
Sky News quoted Gulled Bulhan, a 19-year-old student from Streatham, as saying he witnessed the shooting in front of a shop.
“I was crossing the road when I saw a man with a machete and silver canisters on his chest being chased by what I assume was an undercover police officer - as they were in civilian clothing,” Bulhan said.
“The man was then shot. I think I heard three gunshots but I can’t quite remember.”
In one video of the scene posted on Twitter, but not verified by Reuters, a man can be seen lying on the street while at least two armed police officers point their guns from behind an unmarked car with its blue lights flashing.
At least one helicopter flew overhead and police cars were in surrounding streets, with the area blocked off by tape.
Prime Minister Boris Johnson said on Twitter: “Thank you to all emergency services responding to the incident in Streatham, which the police have now declared as terrorism-related”.
“My thoughts are with the injured and all those affected,” he said.
The last such incident in London was in November, when police shot dead a man wearing a fake suicide vest who stabbed two people to death and wounded three more before being wrestled to the ground by bystanders.
That attack, at London Bridge, was carried out by a man with Islamist militant sympathies. He had been jailed for terrorism and released early.
London’s mayor, Sadiq Khan, said in a statement after Sunday’s incident: “Terrorists seek to divide us and to destroy our way of life - here in London we will never let them succeed.”
More about: London