A self-radicalised Muslim who stabbed his neighbour in an Islamic State-inspired attack claimed to be avenging innocent Iraqis raped and killed by Americans, a Sydney court has been told.

Ihsas Khan was charged with committing a terrorist act and wounding with intent to murder after Wayne Greenhalgh was stabbed multiple times at a Minto reserve in 2016.

The 24-year-old, who had been taking anti-psychotic medication at the time, pleaded not guilty due to mental illness as his Supreme Court trial got underway in Parramatta on Monday.

Scroll down for video

Wayne Greenhalgh was stabbed multiple times at a Minto reserve in 2016 by Ihsas Khan in an Islamic State-inspired attack claimed to be avenging innocent Iraqis raped and killed by Americans, a Sydney court has been told.

Prosecutor Peter Neil SC told the jury Khan repeatedly yelled 'Allahu Akbar' as he attacked the then-57-year-old without warning on Saturday September 10.

The court heard Khan had originally planned to attack a stranger on September 11 to mark the anniversary of the 2001 al-Qaeda attack on the World Trade Centre in New York.

But a day earlier, Khan spotted his victim wearing a t-shirt with an American motif and decided to exact 'revenge for what he regarded as injustices for Muslims in the Middle East', Mr Neil said.

Khan allegedly said United States soldiers had killed his 'brothers and sisters in Iraq' and yelled out 'you rape our women, you rape our children, you bomb our country'.

Ihsas Khan was charged with committing a terrorist act and wounding with intent to murder after Wayne Greenhalgh was stabbed multiple times at a Minto reserve in 2016

The court heard Khan had originally planned to attack a stranger on September 11 to mark the anniversary of the 2001 al-Qaeda attack on the World Trade Centre in New York.

'He was a self-radicalised extremist Muslim and Islamic State supporter,' Mr Neil said in his opening address.

'The accused wanted to become a martyr.'

Khan used a large hunting knife to inflict life-threatening injuries to his victim's arms, hands and body, the court heard.

Ihsas Khan, now 24, (pictured) used a large hunting knife to inflict life-threatening injuries to his victim's arms, hands and body, the court heard

'Mr Greenhalgh ran for his life, he was bleeding profusely,' the prosecutor said.

When police arrived at the scene, Khan tried to stab an officer through the car window glass, and said: 'Kill me, I am here to die.'

Police tasered Khan several times before he was arrested. Mr Neil said he later asked one detective: 'What does it take to get shot by the cops?'

The prosecutor said Khan considered himself to be honouring his 'obligation to jihad'.

When police arrived at the scene, Khan tried to stab an officer through the car window glass, and said: 'Kill me, I am here to die'

Mr Neil said the 'intelligent' university student was motivated by a religious, political or ideological cause to either influence the Australian government or intimidate the public.

The court heard Khan said: 'Maybe if I butcher a guy the government would think again about sending the air force (to Iraq).'

Police tasered Khan several times before he was arrested. Mr Neil said he later asked one detective: 'What does it take to get shot by the cops?'

Defence barrister Mark Ierace SC told the jurors many of the facts of the stabbing wouldn't be disputed with Khan admitting he'd 'tried to slaughter a guy'.

But he said Khan suffered schizophrenia and severe obsessive-compulsive disorder at the time and a central issue during the trial would be his mental state.

The prosecutor argued Khan's psychiatric condition didn't stop him controlling his actions or knowing they were wrong.

The trial before Justice Geoffrey Bellew continues.