Police say men were planning attack in Melbourne with the aim of killing ‘as many people as possible’.

Australian police arrested three men they say were preparing a terrorist attack in Melbourne, the country’s second biggest city, less than two weeks after a man was killed in a rampage that police said was inspired by the Islamic State of Iraq and the Levant group (ISIL).

Australian federal and state police, the Australian Security Intelligence Organisation and other agencies that form part of the country’s Joint Counter Terrorism Team carried out the arrests on Tuesday morning.

The three men – Australians of Turkish descent aged 30, 26 and 21 – will be charged with terrorism-related offences in a Melbourne court later on Tuesday. They will face life in prison if found guilty, police said.

The three were taken into custody after they allegedly sought to acquire a semi-automatic weapon to carry out an attack.

“We now have sufficient evidence to act in relation to preventing a terrorist attack,” Graham Ashton, chief commissioner of Victoria Police, told reporters.

Police said although the suspects had yet to decide on the site of their planned attack, they believed the act was imminent.

Crowds were target

“They were certainly looking at a place of mass gathering, where there would be crowds,” Ashton said. “They were trying to focus on trying to have a place where they could kill as many people as possible.”

Police said they believed the arrests had neutralised any further threat.

Australia, an ally of the United States, has deployed troops to Afghanistan and Iraq.

The country has been on heightened alert since 2014 for attacks by those returning from fighting in the Middle East or their supporters.

Police said the three men were known to authorities and their passports had been cancelled earlier this year because of concerns they would travel to a conflict zone overseas.

The arrests come less than two weeks after a man set fire to a pick-up truck laden with gas cylinders in the centre of Melbourne and stabbed three people, killing one, before being shot by police.

Like that attacker, police said the three men detained on Tuesday had been inspired by ISIL rather than directed by the armed group.