Pain perception is remarkably plastic. Expecting low pain decreases perceived pain intensity, as in placebo analgesia. This occurs even when expectations are violated by the actual pain stimulus intensity, when a prediction error is experienced. Prediction error, the difference between an expected outcome and the actual outcome, is signalled in the brain to update expectations to be more accurate in the future. Indeed, according to computational models of learning, neural signalling of prediction error underlies adaptive behaviour. However, in placebo analgesia, pain intensity expectations continue to influence pain perception despite the prediction error associated with high pain stimulus intensity. This thesis examined pain perception in the context of prediction error and expectation. The structure of the thesis is as follows. Chapter 1 provides a review of the key concepts present in the thesis. In Chapter 2, the methodology of the thesis is described. The measures used in this thesis were electroencephalography (EEG), chosen for its high temporal resolution, and behavioural pain reports, in response to painful stimulation. Chapters 3 and 4 explore the EEG correlates of aversive prediction error. Chapter 3 reports an investigation of the best-known EEG correlate of prediction error in response to appetitive and aversive outcomes. In Chapter 4, the EEG correlate of prediction error to pain is investigated, and we show that cue-evoked expectation modulation of the more practical electrical pain stimulation is equal to that of the more commonly used laser pain stimulation. The remaining studies used electrical stimulation to induce pain. Chapter 5 describes two behavioural studies which explored the effects of cue-evoked expectation and prediction error on pain perception. Here, we show that when prediction error is high, the influence of expectation on pain is reduced, indicating a limit on the influence of expectations on pain. We also test whether the variability of pain modulates the influence of cue-evoked expectation on pain, but do not show a significant modulation. Chapter 6 describes an EEG replication of the placebo analgesia manipulation using a visual cue. This relates the modulation of pain by placebo to that by cue to extend the findings of the thesis to placebo analgesia. Overall, we report an investigation into the EEG correlates of aversive prediction error, and provide evidence that pain perception is the result of the integration of expectation into pain. Results indicate a role for prediction error in pain perception, and suggest the cued modulation of pain is generalizable across pain sensation types. Our results open new avenues for research into aversive learning using EEG, and have implications for future expectation-based therapies for pain.