Serious mental illness, including schizophrenia, bipolar disorder and other psychoses, is linked with high disease burden, poor outcomes, high treatment costs and lower life expectancy. In the UK, most people with serious mental illness are treated in primary care by general practitioners, who are financially incentivised to meet quality targets for patients with chronic conditions, including serious mental illness, under the Quality and Outcomes Framework. The Quality and Outcomes Framework, however, omits important aspects of quality. We examined whether or not better quality of primary care for people with serious mental illness improved a range of outcomes. We used administrative data from English primary care practices that contribute to the Clinical Practice Research Datalink GOLD database, linked to Hospital Episode Statistics, accident and emergency attendances, Office for National Statistics mortality data and community mental health records in the Mental Health Minimum Data Set. We used survival analysis to estimate whether or not selected quality indicators affect the time until patients experience an outcome. Four cohorts of people with serious mental illness, depending on the outcomes examined and inclusion criteria. Quality of care was measured with (1) Quality and Outcomes Framework indicators (care plans and annual physical reviews) and (2) non-Quality and Outcomes Framework indicators identified through a systematic review (antipsychotic polypharmacy and continuity of care provided by general practitioners). Several outcomes were examined: emergency admissions for serious mental illness and ambulatory care sensitive conditions; all unplanned admissions; accident and emergency attendances; mortality; re-entry into specialist mental health services; and costs attributed to primary, secondary and community mental health care. Care plans were associated with lower risk of accident and emergency attendance (hazard ratio 0.74, 95% confidence interval 0.69 to 0.80), serious mental illness admission (hazard ratio 0.67, 95% confidence interval 0.59 to 0.75), ambulatory care sensitive condition admission (hazard ratio 0.73, 95% confidence interval 0.64 to 0.83), and lower overall health-care (£53), primary care (£9), hospital (£26) and mental health-care costs (£12). Annual reviews were associated with reduced risk of accident and emergency attendance (hazard ratio 0.80, 95% confidence interval 0.76 to 0.85), serious mental illness admission (hazard ratio 0.75, 95% confidence interval 0.67 to 0.84), ambulatory care sensitive condition admission (hazard ratio 0.76, 95% confidence interval 0.67 to 0.87), and lower overall health-care (£34), primary care (£9) and mental health-care costs (£30). Higher general practitioner continuity was associated with lower risk of accident and emergency presentation (hazard ratio 0.89, 95% confidence interval 0.83 to 0.97) and ambulatory care sensitive condition admission (hazard ratio 0.77, 95% confidence interval 0.65 to 0.92), but not with serious mental illness admission. High continuity was associated with lower primary care costs (£3). Antipsychotic polypharmacy was not statistically significantly associated with the risk of unplanned admission, death or accident and emergency presentation. None of the quality measures was statistically significantly associated with risk of re-entry into specialist mental health care. There is risk of bias from unobserved factors. To mitigate this, we controlled for observed patient characteristics at baseline and adjusted for the influence of time-invariant unobserved patient differences. Better performance on Quality and Outcomes Framework measures and continuity of care are associated with better outcomes and lower resource utilisation, and could generate moderate cost savings. Future research should examine the impact of primary care quality on measures that capture broader aspects of health and functioning. This project was funded by the National Institute for Health Research (NIHR) Health Services and Delivery Research programme and will be published in full in Health Services and Delivery Research; Vol. 8, No. 25. See the NIHR Journals Library website for further project information.