To prevent errors made during the prescription of drugs, we need to know why they arise. Theories of human error used to understand the causes of mistakes made in high-risk industries are being used in health-care. They have not, however, been applied to prescribing errors, which are a great cause of patient harm. Our aim was to use this approach to investigate the causes of such errors. Pharmacists at a UK teaching hospital prospectively identified 88 potentially serious prescribing errors. We interviewed the prescribers who made 44 of these, and analysed our findings with human error theory. Our results suggest that most mistakes were made because of slips in attention, or because prescribers did not apply relevant rules. Doctors identified many risk factors-work environment, workload, whether or not they were prescribing for their own patient, communication within their team, physical and mental well-being, and lack of knowledge. Organisational factors were also identified, and included inadequate training, low perceived importance of prescribing, a hierarchical medical team, and an absence of self-awareness of errors. To reduce prescribing errors, hospitals should train junior doctors in the principles of drug dosing before they start prescribing, and enforce good practice in documentation. They should also create a culture in which prescription writing is seen as important, and formally review interventions made by pharmacists, locum arrangements, and the workload of junior doctors, and make doctors aware of situations in which they are likely to commit errors.