We describe the use of a closed-loop system to control depth of propofol anaesthesia automatically. We used the auditory evoked potential index (AEPindex) as the input signal of this system to validate it as a true measure of depth of anaesthesia. Auditory evoked potentials were acquired and processed in real time to provide the AEPindex. The AEPindex was used in a proportional integral (PI) controller to determine the target blood concentration of propofol required to induce and maintain general anaesthesia automatically. We studied 100 spontaneously breathing patients. The mean AEPindex before induction of anaesthesia was 73.5 (SD 17.6), during surgical anaesthesia 37.8 (4.5) and at recovery of consciousness 89.7 (17.9). Twenty-two patients required assisted ventilation before incision. After incision, ventilation was assisted in four of these 22 patients for more than 5 min. There was no incidence of intraoperative awareness and all patients were prepared to have the same anaesthetic in future. Movement interfering with surgery was minimal. Cardiovascular stability and overall control of anaesthesia were satisfactory.