Atopic dermatitis (AD) is one of the common allergic diseases in children. The presence of allergic diseases was found to have association with the risk of developing attention-deficit hyperactivity disorder (ADHD) or autistic spectrum disorder (ASD) in children, but it is still inconclusive. This study was to investigate the longitudinal relationship between AD developed during toddlerhood and subsequent development of ADHD or ASD in later childhood. Toddlers born between 1998 and 2008 and diagnosed with AD at the age younger than 3 years and older than 1 month were retrieved from Taiwan's National Health Insurance Research Database. Age- and gender-matched toddlers with no lifetime AD were enrolled as the control group. All enrolled toddlers were followed until 2011 to identify the development of ADHD or ASD. Multivariate Cox regression analysis was performed to analyze the hazard ratios (HRs). The risks associated with allergic comorbidities were analyzed. A total of 18,473 toddlers were enrolled into the AD group. The presence of AD significantly increased the risk of developing ADHD (HR = 2.92, 95% confidence interval [CI] = 2.48–3.45) or ASD (HR = 8.90, 95% CI = 4.98–15.92) when aged 3 years or older. Children from the AD group with 3 comorbidities together, namely, allergic rhinitis, allergic conjunctivitis, and asthma, had the greatest risk of developing ADHD and ASD (ADHD: HR = 4.67, 95% CI = 3.81–5.43; ASD: HR = 16.65, 95% CI = 8.63–30.60). In conclusion, toddlers who suffer from AD at the age younger than 3 years are at a higher risk of developing ADHD and ASD during later childhood. Pediatricians taking care of toddlers with AD should have knowledge of this increased risk of developing ADHD and ASD later in life, especially when children have certain comorbidities such as allergic rhinitis, allergic conjunctivitis, and asthma.