As long as 150 years ago, when Fritz and Hitzig demonstrated the electrical excitability of the motor cortex, scientists and fiction writers were considering the possibility of interfacing a machine with the human brain. Modern attempts have been driven by concrete technological and clinical goals. The most advanced of these has brought the perception of sound to thousands of deaf individuals by means of electrodes implanted in the cochlea. Similar attempts are underway to provide images to the visual cortex and to allow the brains of paralyzed patients to re-establish control of the external environment via recording electrodes. This review focuses on two challenges: (1) establishing a 'closed loop' between sensory input and motor output and (2) controlling neural plasticity to achieve the desired behavior of the brain-machine system. Meeting these challenges is the key to extending the impact of the brain-machine interface.