The identification of modifiable risk factors for Alzheimer's disease is paramount for early prevention and the targeting of new interventions. We aimed to assess the associations between health conditions diagnosed in primary care and the risk of incident Alzheimer's disease over time, up to 15 years before a first Alzheimer's disease diagnosis. In this agnostic study of French and British health records, data from 20 214 patients with Alzheimer's disease in the UK and 19 458 patients with Alzheimer's disease in France were extracted from The Health Improvement Network database. We considered data recorded from Jan 1, 1996, to March 31, 2020 in the UK and from Jan 4, 1998, to Feb 20, 2019, in France. For each Alzheimer's disease case, a control was randomly assigned after matching for sex and age at last visit. We agnostically tested the associations between 123 different diagnoses of the International Classification of Diseases, 10th revision, extracted from health records, and Alzheimer's disease, by running a conditional logistic regression to account for matching of cases and controls. We focused on three time periods before diagnosis of Alzheimer's disease, to separate risk factors from early symptoms and comorbidities. Unadjusted odds ratios (ORs) and 95% CIs for the association between Alzheimer's disease and various health conditions were estimated, and p values were corrected for multiple comparisons. In both the British and French studies, ten health conditions were significantly positively associated with increased Alzheimer's disease risk, in a window of exposure from 2-10 years before Alzheimer's disease diagnosis, comprising major depressive disorder (UK OR 1·34, 95% CI 1·23-1·46; France OR 1·73, 1·57-1·91), anxiety (UK OR 1·36, 1·25-1·47; France OR 1·50, 1·36-1·65), reaction to severe stress and adjustment disorders (UK OR 1·40, 1·24-1·59; France OR 1·83, 1·55-2·15), hearing loss (UK OR 1·19, 1·11-1·28; France OR 1·51, 1·21-1·89), constipation (UK OR 1·31, 1·22-1·41; France OR 1·59, 1·44-1·75), spondylosis (UK OR 1·26, 1·14-1·39; France OR 1·62, 1·44-1·81), abnormal weight loss (UK OR 1·47, 1·33-1·63; France OR 1·88, 1·56-2·26), malaise and fatigue (UK OR 1·23, 1·14-1·32; France OR 1·59, 1·46-1·73), memory loss (UK OR 7·63, 6·65-8·76; France OR 4·41, 3·07-6·34), and syncope and collapse (UK OR 1·23, 1·10-1·37; France OR 1·57, 1·26-1·96). Depression was the first comorbid condition associated with Alzheimer's disease, appearing at least 9 years before the first clinical diagnosis, followed by anxiety, constipation, and abnormal weight loss. These results from two independent primary care databases provide new evidence on the temporality of risk factors and early signs of Alzheimer's disease that are observable at the general practitioner level. These results could guide the implementation of new primary and secondary prevention policies. Agence Nationale de la Recherche.