A man who stabbed dead a stranger waiting at a Sydney bus stop has been found not guilty on the grounds of mental illness.

The 29-year-old man, who cannot be named, was living in transitional housing for people with mental health conditions when he walked outside and killed school teacher Brian Liston at a Camperdown bus stop in December 2015.

The man accused of fatally stabbing Brian Liston at a Camperdown bus stop is interviewed by police. Credit:Seven News

At the time the man was suffering from a schizophrenic illness, Justice Geoffrey Bellew said in his written judgment after a special hearing in the NSW Supreme Court this week.

According to one witness, Mr Liston, 51, yelled, "Why are you doing this?" when he was attacked by the barefooted man.