Ambulatory blood pressure provides a more comprehensive assessment than clinic blood pressure, and has been reported to better predict health outcomes than clinic or home pressure. We aimed to examine associations of clinic and 24-h ambulatory blood pressure with all-cause and cardiovascular mortality in a large cohort of primary care patients referred for assessment of hypertension. We did an observational cohort study using clinic and ambulatory blood pressure data obtained from March 1, 2004, to Dec 31, 2014, from the Spanish Ambulatory Blood Pressure Registry. This registry included patients from 223 primary care centres from the Spanish National Health System in all 17 regions of Spain. Mortality data (date and cause) were ascertained by a computerised search of the vital registry of the Spanish National Institute of Statistics. Complete data were available for age, sex, all blood pressure measures, and BMI. For each study participant, follow-up was from the date of their recruitment to the date of death or Dec 31, 2019, whichever occurred first. Cox models were used to estimate associations between usual clinic or ambulatory blood pressure and mortality, adjusted for confounders and additionally for alternative measures of blood pressure. For each measure of blood pressure, we created five groups (ie, fifths) defined by quintiles of that measure among those who subsequently died. During a median follow-up of 9·7 years, 7174 (12·1%) of 59 124 patients died, including 2361 (4·0%) from cardiovascular causes. J-shaped associations were observed for several blood pressure measures. Among the top four baseline-defined fifths, 24-h systolic blood pressure was more strongly associated with all-cause death (hazard ratio [HR] 1·41 per 1 - SD increment [95% CI 1·36-1·47]) than clinic systolic blood pressure (1·18 [1·13-1·23]). After adjustment for clinic blood pressure, 24-h blood pressure remained strongly associated with all-cause deaths (HR 1·43 [95% CI 1·37-1·49]), but the association between clinic blood pressure and all-cause death was attenuated when adjusted for 24-h blood pressure (1·04 [1·00-1·09]). Compared with the informativeness of clinic systolic blood pressure (100%), night-time systolic blood pressure was most informative about risk of all-cause death (591%) and cardiovascular death (604%). Relative to blood pressure within the normal range, elevated all-cause mortality risks were observed for masked hypertension (HR 1·24 [95% CI 1·12-1·37]) and sustained hypertension (1·24 [1·15-1·32]), but not white-coat hypertension, and elevated cardiovascular mortality risks were observed for masked hypertension (1·37 [1·15-1·63]) and sustained hypertension (1·38 [1·22-1·55]), but not white-coat hypertension. Ambulatory blood pressure, particularly night-time blood pressure, was more informative about the risk of all-cause death and cardiovascular death than clinic blood pressure. Spanish Society of Hypertension, Lacer Laboratories, UK Medical Research Council, Health Data Research UK, National Institute for Health and Care Research Biomedical Research Centres (Oxford and University College London Hospitals), and British Heart Foundation Centre for Research Excellence.