Updated

Three men inspired by the Islamic State group were charged on Tuesday with planning a mass-casualty attack in Australia's second-largest city, police said.

The Australian citizens of Turkish descent were arrested in their Melbourne homes, Victoria Police Chief Commissioner Graham Ashton said. All had had their passports cancelled this year because of security concerns.

Ashton said the trio communicated with encrypted messages, which made it difficult for police to determine when and where the attack was to take place.

"Whilst a specific location was not finalized, there was a view toward a crowded place," where they could kill more victims, Ashton told reporters.

Victoria Police Assistant Commissioner Ross Guenther alleged the men were trying to acquire 0.22 caliber semi-automatic rifles. Semi-automatic rifles are virtually banned from public ownership under Australia's tough gun laws designed to reduce mass-casualty shootings.

Victoria Premier Daniel Andrews thanked state and federal police as well as security agencies for putting themselves at risk to keep the public safe.

"The seriousness of this potential incident should not be underestimated," Andrews said.

The men — 21, 26 and 30 — will appear in a Melbourne court later Tuesday, charged with acting in preparation of a terrorist event. They each could face a life prison sentence if convicted.

There's no link between the latest plot and other attacks and plots in Melbourne. Police have described a fatal stabbing in the city's central business district on Nov. 9 as an Islamic State-inspired terrorist attack. The attacker was shot dead by police after he killed a 74-year-old man and injured two other people, and he had planned to set off an explosion in his burning pickup vehicle loaded with gas canisters. The Somalia-born Australian had had his passport cancelled in 2015.

The man who died, well-known coffee shop owner Sisto Malaspina, was given a state funeral on Tuesday.

Australian Federal Police Assistant Commissioner Ian McCartney said 90 people had been charged in 40 counterterrorism investigations since Australia's terrorism threat level was elevated in September 2014.

"If we had not acted early in preventing this attack, we'll allege the consequences would have been chilling with potential ... significant loss of human life," McCartney said of the latest plot.

Four men also have been convicted of planning a terror attack in downtown Melbourne around Christmas in 2016.

Ibrahim Abbas was sentenced last month to 24 years in prison after pleading guilty to conspiring in preparation of a terrorist attack involving explosives and knives at Federation Square, a popular downtown restaurant and entertainment precinct.

Abbas had been a prosecution witness against his brother Hamza Abbas and co-conspirators Ahmed Mohamed and Abdullah Chaarani. They were convicted of terrorism-related offences three weeks ago, but they have yet to be sentenced.