MELBOURNE, Australia — A knife-wielding man was fatally shot by the police in Melbourne on Friday after he stabbed three people, killing one, in what the authorities described as a terrorist attack.

Witnesses said the man emerged from a vehicle, which then burst into flames, shortly after 4 p.m. The police said there were gas cylinders in the vehicle. The man then began to attack pedestrians on Bourke Street, a busy shopping strip in Melbourne’s city center.

When officers arrived at the scene, they were confronted by the man brandishing a bloody knife. A video of the confrontation, which circulated on social media, shows a civilian bystander trying to help the police by repeatedly pushing a shopping cart at the man.

“Someone screamed, ‘I think he has a knife,’ and I turned around and saw the car on fire,” said Meegan May, who was a passenger on a tram that passed the scene of the attack.