MELBOURNE (Reuters) - A Sydney man was charged on Sunday with committing a terrorist attack and attempted murder that police said seemed to have been inspired by Islamic State, after he repeatedly stabbed a stranger on the street.

The 22-year-old stabbed the 59-year-old man who was walking through a park on Saturday, and attacked police who arrived, making statements that they said led them to conclude he was motivated by IS.

“We know this person has strong extremist beliefs inspired by ISIS,” New South Wales Police Deputy Commissioner Catherine Burn said at a news conference, using an acronym for the militant group originally known as Islamic State in Iraq and Syria.

The victim was in critical but stable condition, Burn said.

Names of both men have been withheld by the police.

Australia, a staunch U.S. ally, has been on heightened alert for attacks by home-grown radicals since 2014 and authorities have said they have thwarted a number of plots. There have been several “lone wolf” assaults, including a 2014 cafe siege in Sydney that left two hostages and the gunman dead.