Jerry Sourian, 23, was shot three times after police were called to the Westfield shopping centre with reports he allegedly had a knife.
Police said two officers tried to speak to Mr Sourian when they arrived, but a “confrontation” ensued and he was shot, eventually collapsing.
Some of the police bullets and shrapnel hit four bystanders.
Mr Sourian was taken to Royal North Shore Hospital, where he remains in a stable condition. Following an investigation by police outside the Hornsby area, he was charged at his bedside on Wednesday with attempted murder, being armed with intent to commit a serious indictable offence, and affray.
He was refused bail and will appear in Hornsby Local Court on June 22.
Mr Sourian allegedly carried a large carving knife as he ran around the forecourt of the shopping centre on June 9 wearing tracksuit pants and no shoes.
He was on day release from Hornsby Hospital’s Adult Mental Health Unit, after he was involuntarily admitted due to schizophrenia.
Lorraine Pendleton, 82, was hit in the back of the knee by a bullet and Elaine For, 65, had a gunshot wound to her lower leg. The pair remain in Royal North Shore hospital in a stable condition.
Anne-Marie Petitfils, 60, remains at Westmead Hospital in a stable condition after being hit by a bullet in the calf.
Another man had a leg grazed by shrapnel but was not hospitalised.