Background: The effect of extreme temperatures on miscarriage is not well understood. Even less understood is the gestational period most vulnerable to extreme temperature exposure, as early miscarriages are often missed in incident datasets. We employ a birth-rate based approach to infer the risk of miscarriage in response to extreme temperature exposure by gestational week. Methods: We conducted a population-based ecological study using birth registry data from the 7,948 municipalities of Italy between 2013 and 2024 (4.5 million births). The analyses were stratified by five climatically coherent macro-regions (Ecoregions). To infer unreported pregnancy losses, we regressed birth rates dated from the last menstrual period against weekly temperatures across gestational weeks 3-21, accounting for temporal seasonality and spatial heterogeneities. Findings: Exposure to heat (mean weekly temperature of 30.4 degree/C) during gestational weeks 3-4 was associated with a reduction of birth rates of 1.62 (0.71 - 2.51)%, and of 1.91 (0.92 - 2.88)% to mean weekly temperature of 1.6 degree/C. Whilst heat was found to be harmful during gestational weeks 3-4 and 18-21, cold spells were found to be consistently harmful from the 3th up to the 12th week, depending on the Ecoregion. Interpretation: Pregnancies are vulnerable to extreme temperatures during the post-conceptual period and the second trimester. The findings underscore the need for a pre-conceptual cohort to clarify the mechanisms of loss, and urge public health action to protect pregnancies from the beginning of gestation.