Two men who were accused of a plot to detonate an improvised bomb in Sydney and kill a member of the public with a knife have pleaded guilty to charges relating to planning a terrorist act.

Omar Al-Kutobi, 25, and Mohammad Kiad, 27, were in February 2015 stopped from carrying out their plot when counter-terrorism police raided a small, converted garage the men had shared in Fairfield, in Sydney’s south-west.

A machete, a hunting knife and a homemade Islamic State flag were seized, police said at the time.

After the men were charged and brought to court, documents revealed the plan involved “an action or a threat of action involving the detonation of an improvised explosive device and/or incendiary weapon, and/or the use of a bladed weapon”.

The documents further alleged the plot was intended to advance a “political, religious or ideological cause” and intimidate the public.

Both men, who are in custody, pleaded guilty to the one charge of doing an act in preparation or planning for a terrorist act when their matters came before the New South Wales supreme court on Wednesday.

Their sentence proceedings are expected to begin on 12 September.