We have a source here Faith and mental health religious resources for healing Templeton Foundation Press 2005 by Harold George Koenig that says Muslims played a key role in setting up some of the first hospitals built for the care of persons with sever mental illness p 29 According to historical record the earliest hospital providing care to the insane was in Cairo built in 872 by Ahmad ibn Tulun the governor of Egypt Muslims also established one of the first hospitals in Europe that was designed specifically for treatment of the mentally ill