The attacker was shot in the chest by police.

A man in Melbourne who set a vehicle on fire and then fatally stabbed one person and injured two others has died in hospital, with police treating the attack as a terrorist incident.

The attacker was shot in the chest by police and died half an hour after arriving at Royal Melbourne Hospital, Victoria Chief Police Commissioner Graham Ashton said on Friday.

"From what we know, we are treating this as a terrorism incident," Ashton said. "We now know a bit more about the identity of that person."

Ashton said the man came to Australia from Somalia in the 1990s and was known to police and counter terrorism authorities. 

The assailant was a "fighter" for Islamic State, the radical group’s mouthpiece Amaq news agency said.

"He carried out the operation in response to [a call] for targeting citizens of the alliance's countries," Amaq added online, referring to a US-led coalition fighting Islamic State.

The claim could not be independently verified by dpa.

Australian Prime Minister Scott Morrison condemned the attack and praised the bravery of police who responded to the scene.

"Australians will never be intimidated by these appalling attacks and we will continue to go about our lives and enjoy the freedoms that the terrorists detest," Morrison said in a statement.

Witnesses reported hearing multiple explosions as the car burst into flames near Bourke Street in the heart of Melbourne on Friday afternoon. Police said barbecue-style gas cylinders had been found inside the vehicle.

"We heard the explosion, and we heard gunshots later," one witness told Australian broadcaster ABC.

The attacker stabbed the victim, believed to be aged in his 60s, in the face, according to local media. 

The two injured victims were being treated at hospital for stab wounds, police said, adding that the police officers were "okay."

A video clip from the scene shared on social media shows a man swinging a knife at two uniformed officers and lunging at them near a burning car before being shot. One of the police officers had his weapon drawn. 

The area was in lockdown four hours after the incident, with police blocking sections of the nearby streets. 

In January 2017, Melbourne man James Gargasoulas allegedly ran down pedestrians on Bourke Street, killing six people. The trial for Gargasoulas, who pled not guilty to murder charges, started this week.