The western Mediterranean region experienced an exceptional and unprecedented early heatwave in April 2023. By shattering historical temperature records, especially in the Iberian Peninsula and northwestern Africa, this extreme offers a stark illustration of a drought–heatwave compound event. Here we investigate the soil moisture–temperature interactions that underpinned this event, using the most up-to-date observations and a novel statistical analysis. Our results reveal that soil moisture deficit preconditions, concurring with a strong subtropical ridge as a synoptic driver, had a key contribution to the amplification and duration of this record-breaking heatwave. Specifically, we estimate that the most extreme temperature records would have been 4.53 times less likely and 2.19°C lower had the soils been wet. These findings indicate that soil moisture content may be a crucial variable for seasonal forecasting of early HW in this region and other Mediterranean climate regimes that already suffering an increment in the frequency of compound drought–heatwave events.