BACKGROUND: Recent studies indicate that chronic insomnia is associated with the development of certain somatic diseases. Whether it would be associated with the development of an autoimmune disease (AID) was unknown. OBJECTIVE: We aimed to examine the association and quantify the magnitude of risk for AID in individuals suffering from chronic insomnia requiring sleep-inducing pills. DESIGN: This was a population-based, nationwide longitudinal study. PARTICIPANTS: Using a claims data set containing 1 million randomly sampled, insured subjects derived from the National Health Insurance Research Database, we assembled a chronic insomnia group and a 1:3 propensity score–matched comparison group (CP), which were balanced in terms of sex, age, insurance premium, urbanization, alcohol use disorder, smoking-related diagnoses, and morbid obesity. MAIN MEASURES: Person-time data with incidence rate, adjusted hazard ratios (aHR) by the Cox model, AID-free survival functions compared with the log-rank test, and a sensitivity analysis on the time lag effect were presented. Incident AID within the first year of follow-up were excluded. The error rate was controlled using the Benjamini–Hochberg procedure. KEY RESULTS: With 39,550 and 129,914 person-years’ follow-up for the chronic insomnia and CP groups (n = 5,736 and 17,208), respectively, we found an increased risk for subsequent AID, representing a 70 % increase in the aHR (1.7; 95 % confidence interval [CI], 1.5–1.9, p < 0.0001). A positive association between chronic insomnia and primary Sjögren’s syndrome (pSS) was observed (aHR, 1.3; 95 % CI, 1.1–1.6). Sensitivity analysis disclosed that AID risk was even stronger after 5 years of follow-up (aHR, 2.0; 95 % CI, 1.7–2.4). CONCLUSION: Chronic insomnia requiring sleep-inducing pills may be associated with a 70 % increased risk for future AID, particularly pSS.