IntroductionFactors that influence antidepressant (AD) prescription and use during pregnancy are multiple including, in particular, the balance between the potential risk of untreated depression and the potential risk of AD treatment. Surveillance of temporal trends of AD use might identify areas requiring further research. We studied the use of ADs before, during, and after pregnancy using national data across two decades in Denmark.MethodsWe included 1,232,233 pregnancies leading to live birth in Denmark between 1 January 1997 and 31 December 2016. Information on redemption of AD prescriptions was obtained from the Danish National Prescription Register.ResultsWe identified 29,504 (2.4%) pregnancies having at least one AD prescription (96,232 AD prescriptions) during pregnancy. The majority redeemed more than one prescription (69.7%) often for a single kind of AD (83.5%), and in 94% of the AD‐exposed pregnancies, the estimated duration of treatment was 1 month or longer. Prescription of ADs during pregnancy increased steadily from 0.4% in 1997 to 4.6% in 2011, but decreased thereafter to 3.1% in 2016. The proportion of pregnancies with ADs in 2011 was 6.05‐fold higher than that in 1997. The temporal trends in AD prescription in the years before and after pregnancy were similar to the trend during pregnancy. The decreasing use of ADs during pregnancy after 2011 was mainly driven by a decrease in the use of selective serotonin reuptake inhibitors (SSRIs), especially citalopram, the main type of SSRIs used in Denmark.ConclusionPrescription of ADs during pregnancy in Denmark increased steadily from 1997 to 2011 but decreased sharply thereafter. More research is needed to show whether the same trend exists in other populations, like women of reproductive age, men of reproductive age, and old people, and other countries. We also need to find explanation for the decreasing trend in recent years and potential risk for untreated depression.