Background: Despite being common and having long lasting effects, mental health problems in children are often under-recognised and under-treated. Improving early identification is important in order to provide adequate, timely treatment. We aimed to develop prediction models for the one-year risk of a first recorded mental health problem in children attending primary care. Methods: We carried out a population-based cohort study based on readily available routine healthcare data anonymously extracted from electronic medical records of 76 general practice centers in the Leiden area, the Netherlands. We included all patients aged 1–19 years on 31 December 2016 without prior mental health problems. Multilevel logistic regression analyses were used to predict the one-year risk of a first recorded mental health problem. Potential predictors were characteristics related to the child, family and healthcare use. Model performance was assessed by examining measures of discrimination and calibration. Findings: Data from 70,000 children were available. A mental health problem was recorded in 27•7% of patients during the period 2007–2017. Age independent predictors were somatic complaints, more than two GP visits in the previous year, one or more laboratory test and one or more referral/contact with other healthcare professional in the previous year. Other predictors and their effects differed between age groups. Model performance was moderate (c-statistic 0.62–0.63), while model calibration was good. Interpretation: This study is a first promising step towards developing prediction models for identifying children at risk of a first mental health problem to support primary care practice by using routine healthcare data. Data enrichment from other available sources regarding e.g. school performance and family history could improve model performance. Further research is needed to externally validate our models and to establish whether we are able to improve under-recognition of mental health problems.