A man has been charged with committing a terrorist act and attempted murder after allegedly stabbing a man in a Sydney park.

Australian Police believe that the man was inspired by so-called Islamic State.

Ihsas Khan, 22, also attempted to stab a police officer before he was arrested.

Khan's victim, 59-year-old Wayne Greenhalgh, was stabbed several times while walking through a park in Minto, in the south-west of the city on Saturday afternoon. He remains in a critical condition.

Khan has been refused bail and his case has been adjourned until Wednesday. He did not enter pleas, but if convicted at trial, he faces a potential life sentence.

It is not believed than Khan and Greenhalgh knew each other, and New South Wales Deputy Police Commissioner Catherine Burn described the attack as planned and deliberate.

Passersby were reported to have put their own lives at risk when they intervened in the attack.

The arrest comes just days after so-called Islamic State urged followers to shoot, stab, poison, and run over Australians at iconic locations, including the Sydney Opera House.