Dramatic footage showed two police officers trying to arrest the man as he lunges and slashes wildly in broad daylight on Bourke Street with his vehicle burning in the background.
Victoria state police Commissioner Graham Ashton says the suspect, who was originally from Somalia, was known to police, mostly because of family members who were "persons of interest" to police.
Nevertheless, members of the public have been heaping praise on Trolley Man for his bravery.
Footage on social media shows a blue ute up in flames and a man dressed in a black tunic and white trousers menacing police with what appears to be a knife.
According to The Age, anti-terror police believe Ali had planned to set fire to three gas cylinders in the ute's rear tray.
The attacker is in hospital in a critical condition and investigators have not released any information about his identity.
"It looks like he's attempted to ignite a fire in the vehicle, we believe at this stage with a view to igniting those canisters with some sort of explosion, but that didn't eventuate", Commissioner Ashton said.
Police quickly arrived on the scene, Ashton said.
Victorian Premier Daniel Andrews said the attack was "an evil, terrifying thing that's happened in our city".
Witnesses said the man began attacking pedestrians near a pickup truck apparently belonging to the attacker which had exploded into flames.
A total of three people were stabbed during the assault, police revealed during a press conference.
The attacker, who police said was 31, died in hospital, as did one of the victims, Ashton said.
One listener said he could see a white sheet over a body.
All of the victims were men, Ashton said.
"He was breathing and he was bleeding out".
He was shot in the chest after attempting to assault police officers and taken to Royal Melbourne Hospital, where he died of his injuries around 30 minutes later.
When police responded to calls about the burning vehicle, the man brandished his knife and threatened them.
A police statement said: "Police are aware of an incident in the vicinity of Bourke Street".
The text was referring to a call in August by Islamic State leader Abu Bakr al-Baghdadi to "use bombs, knives or cars to carry out attacks" in countries taking part in the US -led coalition that put an end to the caliphate he declared in 2014 over parts of Iraq and Syria.
At the time of this writing, few other news organizations have supplied a name for the suspect, although Australia's Herald Sun cited police sources who said the suspect's wife is "missing and is believed to have been radicalized", as the Daily Mail also indicated.
However, Shire Ali was never targeted by a Joint Counter Terrorism Teams (JCTT) investigation because an assessment was made that he did not pose a threat to national security.