Two men were charged on Wednesday with planning to launch an imminent terrorist attack in Australia, after police seized a homemade flag associated with Islamic State in Iraq and Syria (ISIS), a machete and a hunting knife in a counterterrorism raid.

The men, aged 24 and 25, would have carried out the attack on Tuesday if they had not been arrested that day in the raid in the Sydney suburb of Fairfield, New South Wales state Deputy Police Commissioner Catherine Burn told reporters.

A video that was seized during the raid showed one of the men making threats, though Burn declined to detail exactly what was said. Australian Attorney General George Brandis later told the Senate that the video depicted one of the suspects kneeling in front of the ISIS flag with the knife and machete while making a politically motivated statement and threatening to commit "violent acts" with those weapons.

The men planned to launch their attack in western Sydney, he said.

Asked whether they were planning a beheading, Burn replied, "We don't really know what act they were going to commit."

"What we are going to allege is consistent with the IS messaging," she said, using an abbreviation for the Islamic State group. "We believe that the men were potentially going to harm somebody, maybe even kill somebody, and potentially using one of the items that we identified and recovered yesterday, potentially a knife."

Police were trying to determine whether the men were in contact with anyone from the ISIS movement.

"Yesterday, our focus was to act on information that we received about something that was imminent," Burn said. "We believe that we have stopped that threat from occurring. However, there are further investigations that now we will need to follow through."

Omar Al-Kutobi and Mohammad Kiad were charged with undertaking acts in preparation or planning for a terrorist act, which carries a maximum punishment of life in prison. Their lawyer didn't apply for bail and it was formally refused during a brief court hearing Wednesday. Neither man appeared in the courtroom.

Police don't believe there is any link between the alleged plot and another plot that prompted a series of counterterror raids in Sydney in September. One man arrested during those raids was charged with conspiring with an ISIS leader in Syria to behead a random person in Sydney.

Australia's government raised the country's terror warning level in September in response to the domestic threat posed by supporters of ISIS, which has threatened Australia in the past. In September, its spokesman Abu Mohammed al-Adnani issued a message urging attacks abroad, and specifically mentioned Australia.

In December, Man Haron Monis, an Iranian-born, self-styled cleric with a long criminal history, took 18 people hostage inside a downtown Sydney cafe. Among his demands was that he be delivered an Islamic State flag. Investigators, however, have said it doesn't appear Monis had established any contact with the Islamic State group.

Prime Minister Tony Abbott said he suspected the terror threat in Australia was going to only worsen.

"As we have seen again and again in recent times, the death cult is reaching out all around the world, including here in Australia," Abbott told Parliament. "There are people in this country who are susceptible to these incitements to extremism and even terrorism."

The government believes about 90 Australians are fighting alongside the Islamic State movement in Syria and Iraq, with another 140 supporting the group from Australia.