Two men facing terrorism charges in Australia were involved in an aborted attempt to place an improvised explosive device on an Etihad Airways flight out of Sydney last month in a plot directed by the Islamic State of Iraq and the Levant (ISIL, also known as ISIS) group, police said on Friday.

One of the men, a 49-year-old from Sydney, brought the device to Sydney airport on July 15 in a piece of luggage that he had asked his brother to take with him on the flight - without telling the brother that the bag contained explosives, Australian Federal Police Deputy Commissioner Michael Phelan told reporters.

But for reasons still unclear, the bag never got past the check-in counter. Instead, Phelan said, the 49-year-old man left the airport with the bag, and his brother continued on to the flight without it.

READ MORE: As ISIL's 'caliphate' crumbles, its ideology remains

"This is one of the most sophisticated plots that has ever been attempted on Australian soil," Phelan said. "If it hadn't been for the great work of our intelligence agencies and law enforcement over a very quick period of time, then we could well have a catastrophic event in this country."

The details Phelan provided on Friday are the first that officials have released since four men were arrested in a series of raids in Sydney last weekend. The 49-year-old man and a 32-year-old have been charged with two counts of planning a terrorist act.

A third man remains in custody, while a fourth was released without charge. The 49-year-old's brother has not been charged in connection with the plot, because police believe he had no idea the bag contained explosives, Phelan said.

Police have not released the names of any of the suspects.

Links to ISIL

The components for the device, including what Phelan described as a "military-grade explosive", were sent by a senior ISIL member to the men in Sydney via air cargo from Turkey.

An ISIL commander then instructed the two men who have been charged on how to assemble the device, which police have since recovered, Phelan said.

After the July 15 bid failed, the men changed tactics and were in the early stages of devising a chemical dispersion device, which they hoped could release highly toxic hydrogen sulfide, Phelan said. No specific targets had been chosen, though an ISIL member had given the men suggestions about where such devices could be placed, such as crowded areas or on public transport.

"Hydrogen sulfide is very difficult to make, so I want to make it quite clear that while it may be a hypothetical plot, we were a long way from having a functional device," Phelan said. "There were precursor chemicals that had been produced, but we were a long way from having a functioning (device)."

Police had no idea either of the plans in the works until they received a tip through intelligence agencies on July 26, Phelan said. They arrested the men on July 29.

The allegation that ISIL was able to ship explosives to Australia undetected was troubling, Phelan acknowledged.

"All the security agencies and those responsible for security of cargo and so on have put in place extra measures since that time," Phelan said. "It is concerning that it got through, yes, it's hard to deny that."