Australian police have arrested a man accused of planning a mass shooting for New Year's Eve in a crowded Melbourne square, officials said on Tuesday.

The 20-year-old Australian-born citizen with Somali parents was trying to obtain an automatic rifle to attack the downtown Federation Square in Australia's second largest city, Victoria State Police Deputy Commissioner Shane Patton said.

Thousands of revelers pack the square each year on New Year's Eve.

The man, who was not named, downloaded instructions from an al-Qaida in the Arabian Peninsula website on how to launch a terrorist attack and how to use guns, Patton said.

Patton described the suspect as "a person who's expressed an intention to try and kill as many people as he could through shooting them."

He said authorities have eliminated the threat of the attack, saying "the risk that was posed by this person has been removed."

Counter-terrorism police had been monitoring the man, a known extremist and a sympathizer of the Islamic State group, this year and detained him as he met with people in an attempt to acquire a gun, Patton said.

Australia has strict gun laws and automatic weapons are banned from private ownership.

The man is the 74th suspect arrested in Australia in 31 counter-terrorism investigations since Australia's terrorism threat level was elevated to "probable" in September 2014.

Police expect he will appear in a Melbourne court late on Tuesday or Wednesday on charges of preparing to commit a terrorist attack and collecting documents to facilitate a terrorist act.

People convicted of those crimes in Australia face a maximum penalty of life in prison.

Search warrants were issued on Monday at a home in a suburb where the suspect lived with his parents and siblings, at a relative's address in another suburb and at a computer business where he once had a part-time job.