Mr Hassan and four other leaders from Melbourne’s Somali community went to the unit on Saturday morning to see the accused man to provide support because he has mental health problems, a police summary says.
Mr Abdishakur Ahmed allegedly took a kitchen knife and stabbed Mr Hassan and then chased his friend.
Ambulance paramedics treated Mr Hassan in the unit but he died in hospital.
Members of the police Critical Incident Response Team arrested Mr Abdishakur Ahmed at the unit.
Magistrate Luisa Bazzani remanded Mr Abdishakur Ahmed, from the northern suburb of Dallas, in custody to next appear before court in April.
Defence lawyer Glenn Cooper said Mr Abdishakur Ahmed had been seen by a nurse while in custody.
Farah Warsame, another leader of Melbourne’s Somali community, said Mr Hassan was highly regarded for helping others as a community worker and through fundraising for the less fortunate.
“He was a really good guy. The community was very shocked when we heard it,” Mr Warsame said.
“He was a good man. Spiritually, he was a very good person.”