As a ute blazed in the background, a man lunged with a long knife at police officers, who backpedalled desperately. Bystanders jumped into the fray, one wielding a chair, another a shopping trolley, before the assailant, identified as Hassan Khalif Shire Ali, was finally neutralised.

This scene of confusion and chaos unfolded on Melbourne's busy Bourke Street on Friday afternoon, as thousands finished their working weeks and spilled out onto the streets.

The incident unfolded in a matter of seconds, but it was captured from a number of different angles by bystanders on their smartphones.

Explosion on Bourke Street

Police were called to the area about 4:20pm. ( Twitter: Meegan May )

An explosion is heard on Bourke Street at 4:10pm.

"I kept watching," said witness Tony Nguyen, after what he described as a "car bomb".

"I didn't realise everyone was running and that's when a really tall black guy was near the car, but then someone was approaching the car and he was checking to see if everyone was OK, and that's when the man stabbed the other guy and that's when I ran."

Police arrive to find a man attacking people

Sorry, this video has expired Witnesses capture a car fire on Bourke St, Melbourne

Two police officers arrive almost instantly to find a blue utility vehicle ablaze, with flames shooting high into the air.

A tall man wearing a long black coat and holding a knife has already stabbed three people.

They park their police car just behind the burning ute and are immediately attacked.

The man attacks police, bystanders intervene

Eyewitness video shows the police and the suspect in front of the burning car. ( Supplied )

The assailant punches one of the officers through the car window. They get out of the vehicle and the man lunges at them, swinging a knife. They duck and sway, backing away, moving around a signpost to avoid the blows.

A man wearing a black shirt and khaki pants involved himself in the fracas, using a trolley to attempt to run into the attacker.

A man with a shopping trolley approaches the Bourke Street attacker. ( Supplied )

Bystanders were yelling out, "just shoot him, just shoot him!" as officers tried to avoid being stabbed.

One man threatened the attacker with a chair during the attack. ( Supplied )

The police can be seen backtracking to avoid the flailing attacker as the trolley-pusher tries to ram him head-on — he falls over in the process, then gets up again and takes control of the trolley once more.

He then launches the trolley at the man, who continues to pursue the policemen — but the trolley misses and crashes over.

As the attacker pursues police across the street and they back away, the man recovers his trolley and follows.

Another bystander, wearing a chequered shirt, also moves in from the side to help, as does a third man in a blue jacket wielding a chair.

Officer opens fire

Police arrived at the scene almost instantly. ( Twitter: @_sarah_sarah )

It's at this point, with the attacker slashing at the police, one of the officers has enough time and space to shoot him once in the chest.

Police took the opportunity to shoot the man after he came at them with a knife. ( Supplied )

He goes down and is leapt upon by the two policemen — just as another unmarked police vehicle arrives on the scene and a small explosion flares up from the burning truck.

The two officers apprehend the attacker after a brief struggle on the ground. They had suffered a few minor injuries from the blade and the earlier punch.

Police turn their attention to the victims, one of whom was still lying on the street.

"Turned out there was an old man in front of me, literally by my feet," a witness said.

Police intelligence officers arrive at the scene. ( ABC News: Danielle Bonica )

"He was facedown, facedown, and there was a lot of blood."

Police would later say he had died at the scene.

The attacker also died half an hour after being taken to hospital under guard. Police are treating it as a terrorist incident.

"In the midst of tragedy, you can find such pride in the work of by-standers to come to the aid of others," said Victorian Premier Daniel Andrews.

"We'll not, as a city and a state, be defined by this act of evil. We'll simply refuse to do that."