New South Wales Deputy Police Commissioner Catherine Burn said the planned attack was "consistent with the messaging coming out of IS", while New South Wales state Premier Mike Baird described it as "beyond disturbing".
Asked whether the plot involved a beheading, Burn said police were as yet unsure, but that it had been due to happen Tuesday in Sydney, and would likely have involved a knife.
Reportedly devout Muslims, they were refused bail with the case adjourned until Thursday due to security issues.
"A number of items were located including a machete, a hunting knife, a home-made flag representing the proscribed terrorist organisation IS, and also a video which depicted a man talking about carrying out an attack," Burn said.
More From This Section
"We will allege that both of these men were preparing to do this act yesterday. We built up information, we received further information which indicated an attack was imminent. And we acted."
In another unprovoked attack in May 2013, two Britons of Nigerian descent hacked to death 25-year-old soldier Lee Rigby near an army barracks in the southeast of London.
Attorney-General George Brandis told parliament the video seized allegedly showed "one suspect kneeling in front of an ISIL flag, with the knife and machete, making a politically motivated statement, threatening to undertake violent acts with those weapons".
ISIL is another name for the Islamic State group.
Baird said a potentially "catastrophic" incident had been avoided.
"It was beyond disturbing, what was planned," he told reporters. "Certainly, something catastrophic was avoided yesterday and for that we should be very thankful.