Accused murderer ruled 'mentally ill'