Extremely hot weather appears to prompt early labor, leading to as many as 25,000 early births every year in the U.S., according to a study published Monday.

The research, published in the journal Nature Climate Change, analyzed data on 56 million births from 1969 to 1988, matching the birth dates to weather events in the counties where babies were born.

"We saw a spike in births on hot days," said study author Alan Barreca, an associate professor in environmental economics at the University of California, Los Angeles. For example, Barreca noticed a 5 percent increase in birth rates on days that were over 90 degrees Fahrenheit.

But when researchers looked at birth rates over the days and weeks that followed extreme heat events, they found a decline in births. That decline, the study suggests, is the result of births taking place earlier than expected.

"That rise, then fall, indicates a forward shift or an acceleration of deliveries and ultimately a loss of up to two weeks gestation for those births," Barreca told NBC News. "If you calculate the average, it's a loss of about six days gestation."

Experts say that that last week of gestation is important, especially for the development of babies' lungs. Babies born around 38 weeks may have more trouble transitioning to breathing on their own, increasing the likelihood of their spending more time in the neonatal intensive care unit.

The findings come as representatives from hundreds of countries gather in Madrid for the opening of the U.N. Climate Change Conference COP25 to address global warming. The new study from UCLA makes an ominous prediction that if global temperatures continue to rise at current projections, an extra quarter million gestational days — days that fetuses should remain in utero — will be lost by the end of the century.

"It's one more study showing a high-level message, which is that extreme temperature is more and more associated with obstetric outcomes, including preterm births and low birth weight," said Dr. Nathaniel DeNicola, an OB-GYN at George Washington University Hospital, and an environmental health expert with the American College of Obstetricians and Gynecologists (ACOG).

He said the fact that 56 million live births were included in the analysis "makes a compelling case that the association is not random, and that there actually is a linkage between the exposure and the outcome." (The study, however, only shows an association and cannot prove cause-and-effect.)

Indeed, ACOG calls climate change an "urgent women's health concern."

It's unclear why unusually hot days might set childbirth into motion, but dehydration may play a role. When the body becomes dehydrated, it releases hormones, such as oxytocin, that are also involved in labor.

Authors of the new research said they focused only on unusual or unpredictable changes in temperature, not typical weather patterns. While premature birth rates do tend to be higher in warmer states — Mississippi versus Vermont, for example — the reasons for such disparities are often socioeconomic.

Barreca said there's evidence air conditioning could help reduce the risk of early birth, adding it's crucial to implement policies that would make air conditioning both cheaper and more energy efficient.

"Running the air conditioning is expensive, and if it’s expensive, that’s potentially going to add financial stress to households with lower incomes," Barreca said.

According to the March of Dimes, the preterm birth rate in the U.S. has been steadily rising, from 9.6 percent in 2015, to more than 10 percent in 2018.

Follow NBC HEALTH on Twitter & Facebook.