Background: The number of children with maternal mental illness (MMI) is rapidly increasing and less is known about the effects of maternal mental illness on childhood atopy. Aim: To investigate the association between MMI and risk of atopy among offspring. Design and setting: Retrospective cohort study in a UK primary care database (674 general practices). Methods: 590,778 children (born 1st January 1993-30th November 2017) followed until their 18th birthday, linked to their hospital records. We captured time-varying exposure to common (depression, anxiety) serious (psychosis) addiction (alcohol and substance misuse) and other (eating, personality disorder) MMI from six months before pregnancy. Using Cox regression models, we calculated and compared incidence rates of atopy of exposed and unexposed children in primary (asthma, eczema, allergic rhinitis and food allergies) and secondary (asthma, food allergies) care, adjusted for maternal (age, atopy history, smoking, antibiotic use), child (sex, ethnicity, birth year/season) and area covariates (deprivation, region). Results: Children exposed to common MMI were at highest risk of developing asthma and allergic rhinitis (aHR: 1.17, 95%CI=1.13-1.21) and a hospitalisation for asthma (aHR 1.29, 95%CI1.20-1.38). Children exposed to addiction disorders were 9% less likely to develop eczema (aHR: 0.91, 95%CI=0.85-0.97) and 35% less likely to develop food allergies (aHR 0.65, 95%CI=0.45-0.93). Conclusions: The finding that risk of atopy varies by type of MMI prompts important aetiological questions. The link between common mental illness and childhood atopy requires general practitioners and policies makers to act and support vulnerable women to access preventive (e.g. smoking cessation) services earlier.