Objective:to examine the associations of COVID-19 lockdown with gestational length and preterm birth (PTB). Design: Hospital-based retrospective study. Setting: All hospitals in Foshan (n=62) and several other hospitals in Guangzhou (n=1), Shenzhen (n=1), Dongguan (n=2), and Jiangmen (n=1) in Guangdong Province, China were selected. Population and Methods: A total of 595396 singleton live infants born between 2015 and 2020 were included. The exposed group (N=101900) included women who experienced the COVID-19 Level I lockdown (1/23-2/24/2020) during pregnancy, while the unexposed group (N=493496) included women who were pregnant during the same calendar months in 2015-2019. Cumulative exposure was calculated based on days exposed to different levels of emergency responses with different weighting [1/22/2020 or earlier (no response, weighting=0), level I (weighting=3), 2/25-5/9/2020 (level II, weighting=2), and 5/10-12/31/2020 (level III, weighting=1)]. Main outcome measures: demographics, lockdown exposure, preterm birth, gestational week. Results: The exposed group had a shorter mean gestational length than the unexposed group (38.66 vs 38.74 weeks: adjusted β=-0.06 week [95%CI, -0.07, -0.05 week]). The exposed group also had a higher risk of PTB (5.7% vs 5.3%; adjusted OR=1.08 [95%CI, 1.05, 1.11]). These associations seemed to be stronger when exposure occurred before or during the 23rd gestational week (GW) than during or after the 24th GW. Conclusions: The COVID-19 lockdown measures were associated with a slightly shorter gestational length and a moderately higher risk of PTB. Early and middle pregnancy periods may be a more susceptible exposure window. Funding: National Natural Science Foundation of China.