Background Gestation at birth is associated with short and long-term outcomes. This study used high quality, national, administrative data to examine trends in gestation at birth in Scotland. Methods This observational study used maternity hospital discharge records for 2005 to 2019 to determine trends in the percentage of live births that were preterm (<37 weeks gestation), term (37–41 weeks), and post-term (≥42 weeks), overall and by maternal age and deprivation category. Preterm births were further examined by category of preterm birth (moderate to late [32–36 weeks]; very [28–31 weeks]; extremely [<28 weeks] preterm), and onset of labour (spontaneous; provider-initiated). Singleton and multiple births were examined separately. Aggregate logistic regression was used to estimate the annual change in the odds of a birth being in a specified gestational category. Results The percentage of singleton births in Scotland that were preterm decreased from 2005 (6.5%, 3,361/51,665) to 2010 (5.8%, 3268/56344), then increased to 2019 (7.2%, 3,408/47,507). The percentage of singleton births that were spontaneous moderate to late, very, and extremely preterm all increased between 2010 and 2019. The percentage of singleton births that were provider-initiated moderate to late preterm also increased between 2010 and 2019, however provider-initiated very or extremely preterm birth decreased. The percentage of singleton births that were preterm increased over time across all maternal age and deprivation categories, with increases greatest in groups at highest baseline risk. The percentage of singleton births that were post-term increased from 2005 to 2009, then decreased to 2019. Conclusions There has been an increase in spontaneous preterm birth from 2010 to 2019, which is not fully explained by changes in maternal age or deprivation. Further research to examine the contribution of other, preventable, risk factors is warranted. Trends in provider-initiated preterm birth, and post-term birth, are likely to reflect changing clinical practice.