His identity was not revealed but police said he came to Australia from Somalia in the 1990s.
Police had been called to the auto at 4.20pm local time on Friday, by which point the man had already started attacking bystanders.
At one point, the man is knocked off his feet.
The man was shot in the chest by police.
Later, a man was arrested after he was shot at the scene and taken to a hospital under police guard in a critical condition.
Police were treating the attack as terror-related at this stage, and counter-terrorism investigations were continuing into Ali's background.
"We don't believe there is an ongoing threat at this stage, but certainly we are treating it as a terrorism incident", Ashton said.
The unnamed terror suspect was transported to Royal Melbourne Hospital, where he later died.
The man, whom police say had been on their counterterrorism radar already, set a vehicle on fire in the city to attract a response and then began swinging a knife wildly.
Ashton said the suspect was known to police and federal intelligence authorities.
"We take this opportunity to thank those very fearless and dedicated members of Victoria Police who did all of us proud in their very quick response in very unsafe circumstances", Andrews said. Another two victims have injuries to their upper body.
Police shot and subdued the knife-wielding assailant, who later died in the hospital, Graham Ashton, the chief commissioner confirmed.
Clayton added that the bomb squad had cleared the area and deemed it safe, and that fire crews had extinguished the burning vehicle.
Bourke Street has since been reopened, and Melbourne residents are advised that planned weekend events at Flemington and Remembrance Day commemorations will still go ahead as planned.
Bourke Street Mall, a pedestrian strip and shopping area popular with foreign tourists including Japanese, was previously the scene of auto rampage in 2017 that left six people dead.
"Because he was on his stomach, they turned him over to see if he's all right, he was still alive", the witness, Markel Villasin, told Australian Associated Press.
Australian Prime Minister Scott Morrison said the country would be unflinching in the fight against "radical, violent. extremist Islam that opposes our very way of life".
Islamic State said one of its fighters carried out the knife attack.
Victoria's Premier Daniel Andrews praised members of the public for stepping in.
Police warned people to avoid the area, although the suspect is believed to have been detained.
In December 2014, two hostages were killed during a 17-hour siege by a "lone wolf" gunman, inspired by ISIL, in a cafe in Sydney.