IntroductionTo guide improvements in treatment for pregnant persons with substance use disorders within the criminal legal system, treatment programs must first determine the primary substances of concern for this population. The objective of this study is to compare trends in specific substance use upon admission to treatment in pregnancy, based upon whether referrals originated from the criminal legal system or from another referral source. MethodsThis research accessed data on perinatal substance use (1995–2021) and referral sources from the Treatment Episode Data Set-Admissions (TEDS-A). Analyses use multiple logistic regressions to evaluate trends in primary substance use leading to treatment admission during pregnancy. ResultsApproximately 1 % (N = 536,948) of all substance use treatment admissions in TEDS-A were for pregnant people. Between 1995 and 2021, the percentage of treatment admissions increased for primary methamphetamine use (10 % to 27 %), primary opioid use (21 % to 38 %), and primary cannabis use (9 % to 18 %), and decreased for primary cocaine use (32 % to 6 %) and primary alcohol use (26 % to 11 %). By 2021, treatment admissions referred from criminal legal agencies were more likely to primarily be for primary methamphetamine use (33 % vs 25 %) and less likely to be for primary opioid use (22 % vs 42 %) compared to other referral sources. ConclusionsTrends in substance use treatment during pregnancy have changed substantially over the past few decades and emphasize the unique needs of patients referred to treatment by the criminal legal system. Treatment programs must therefore adapt to fluctuating trends in perinatal substance use. In particular, it is important to expand programs that prioritize treatment of methamphetamine use disorder for pregnant people referred through criminal legal agencies.