To examine pregnancy outcomes among births to women with idiopathic inflammatory myopathy (IIM) in relation to time of IIM diagnosis using population-based data. This study used Swedish nationwide registers to identify all singleton births that occurred between 1973 and 2016 among women diagnosed with IIM between 1998 and 2016 and among women unexposed to IIM. We classified births according to the IIM status of the mother at time of delivery: post-IIM (n = 68), 1-3 years pre-IIM (n = 23), >3 years pre-IIM (n = 710) and unexposed to IIM (n = 4101). Multivariate regression models were used to estimate relative risks of adverse pregnancy outcomes in post-IIM births and pre-IIM births separately, in comparison with their non-IIM comparators. We found that post-IIM births had increased risks of caesarean section [adjusted relative risk (aRR) = 1.98; 95% CI: 1.08, 3.64], preterm birth (aRR = 3.35; 95% CI: 1.28, 8.73) and low birth weight (aRR = 5.69; 95% CI: 1.84, 17.55) compared with non-IIM comparators. We also noticed higher frequencies of caesarean section and instrumental delivery in 1-3 years pre-IIM births than in the non-IIM comparators. Women who gave birth after IIM diagnosis had higher risks of caesarean section, preterm birth and low birth weight. These results further underline the importance of special care and close monitoring of women with IIM. Higher frequencies of caesarean section and instrumental delivery in pre-IIM births highlight the need for future research on the influence of subclinical features of IIM on pregnancy outcomes. © The Author(s) 2020. Published by Oxford University Press on behalf of the British Society for Rheumatology.