Australian police have said they are treating a deadly shooting and siege in Melbourne as a terrorist incident, after the so-called Islamic State group said it was behind the attack.

A man of Somali background was killed in a gun battle with police when he opened fire after taking a woman hostage at an apartment block in the city yesterday evening.

It is alleged Yacqub Khayre, 29, had first killed a Chinese-born Australian man in the foyer.

Police said he had made statements "around al-Qaeda" and called a local television station making similar comments, reportedly saying: "This is for IS, this is for al-Qaeda."

Islamic State said via its news agency, Amaq, that the attack was launched because of Australia's membership of a US-led coalition against the militant group.

"The executor of the Melbourne attack in Australia is a soldier of the Islamic State and he carried out the attack in response to appeals to target citizens of coalition states," it said.

Bomb squad police at scene of siege

Australia has been on high alert for attacks by home-grown militants returning from fighting in the Middle East or their supporters.

Australian officials say they have prevented 12 attacks since the threat level was raised in September 2014, with more than 60 people charged - but four have gone ahead, including the murder of a Sydney police employee in 2015 by a 15-year-old boy.