Where did the term 'Ghost in the Machine' come from?

When discussing matters related to consciousness, be it within ourselves or the fields of Artificial Intelligence, you have probably come across the term 'Ghost in the Machine'.

Even in the anime series Ghost in the Shell (whose name itself is a variant of the same concept), the blue think-tanks called Tachikomas, imbued with their own AI, begin to wonder if they will ever have 'ghosts'.  And the main character, herself a full cyborg with only a cyberbrain left from her humanity, often makes reference to hers and others ghosts.  In this context 'ghost' can be seen as another word for consciousness.

It is hard to avoid the term, especially as we strive to create truly sentient Artificial Intelligence, but where did it come from?

The question of what and where is conscious is still debated to this day, and was covered recently in an episode of Through the Wormhole hosted by Morgan Freeman called When does life begin? (S04E02).

We can go back to French philosopher RenĂ© Descartes, who in the 17th century proposed that there is a difference between the brain and consciousness, even if they seem to be related.  This philosophy came to be known as dualism.

It fell out of favor with the rise of more scientific based methods, especially those that developed in the realms of psychology.  At the turn of the century it seemed that every aspect of life could be broken down, categorized, and explained.  The almost metaphysical concept of dualism was abandoned in favor of  the idea that only the physical parts of the brain and its components should be studied which came to be known as materialism.

The the term "Ghost in the shell" originates from an Oxford philosopher by the name of  Gilbert Ryle to discount dualism's idea that some nonphysical form of consciousness could affect, and influence the physical brain.

Even now, with all of our advanced technologies to map the neurons and pathways of our grey matter, the question of what exactly is consciousness and where it is located has so far eluded scientists trying to pinpoint it to specific areas.

As the fields of Artificial Intelligence continue to develop, this question still lingers.  If we build a large enough computer, with enough simulated neural networks, could the machine we created become self-aware and achieve what we have defined as consciousness?

Many scientists and futurists are of the opinion that we will.  And yet there are others who seem to think that these possibilities will always remain in the realms of science fiction.