The man accused of murdering a woman in a Sydney unit before stabbing another woman in the CBD will defend the charges on the grounds of his mental health.

Mert Ney, 20, was on Friday night charged with murder, attempted murder, wounding with intent to cause grievous bodily harm, intentionally choking with recklessness and common assault.

Police allege he killed sex worker Michaela Dunn, 24, in a Clarence Street apartment on Tuesday before allegedly stabbing Linda Bo, 41, in the shoulder at the Hotel CBD.

The 20-year-old was later filmed allegedly running through the city streets brandishing a bloodied kitchen knife before being restrained by onlookers and arrested.

Ney appeared before Parramatta bail court on Saturday, bail was not applied for and was formally refused.

Zemarai Khatiz, lawyer for Mert Ney, says his client is ‘going through a very difficult situation at this time’. Photograph: Bianca de Marchi/AAP

Outside court Ney’s lawyer, Zemarai Khatiz, said his client intended to defend the charges.

“He’s going through a very difficult situation at this time,” he told reporters. “But in relation to the allegations he will be defending the charges on the grounds of mental illness ... and it will be a matter for trial at a later date.”

Ney appeared subdued as he listened to the court discuss his matter dressed in a green prison jumper.

Earlier, Khatiz asked the court to make a recommendation that his client be seen by Justice Health urgently.

“He hasn’t been given his pain medication, he’s asked for it six times now so that is why we asked the court to make an order,” he told reporters.

The court heard Ney had undergone surgery for a “severe” leg injury while in hospital.

Khatiz said his client had also told him he had not been given medication for his mental illness.

The magistrate recommended Ney be seen “urgently” by Justice Health to “attend to any required medication for pain relief and also in relation to his mental illness”.

Ney was allegedly carrying a USB stick with information about recent mass casualties in New Zealand and the United States and could be heard on video footage shouting “Allahu akbar”.

NSW police have not classed the attack as a terrorist incident and have not identified any links to terrorist organisations.

Ney will next face central local court on Monday 19 August as police make an application to carry out a forensic procedure on him.