Climate change could reduce fertility rates in male insects by at least half, according to a study published Tuesday in Nature Communications. This is bad news for bugs and humans alike, because insects play a crucial role in pollinating our crops and stabilizing many of the food webs and ecosystems that we rely on.

Led by Kirs Sales, a postgraduate researcher at the University of East Anglia in the UK, the research found that increasingly intense heat waves pose a serious threat to the reproductive fitness of insects worldwide.

“Heat waves reduce male fertility and sperm competitiveness, and successive heat waves almost sterilize males,” Sales and his co-authors wrote in the study. “This male reproductive damage under heat wave conditions provides one potential driver behind biodiversity declines and contractions through global warming.”

The researchers exposed red flour beetles, a commonly studied model organism, to heat wave conditions in a laboratory. A group of 56 males and 55 females spent five days living in sex-segregated petri dishes warmed to 40°C (104°F), which is 5°C hotter than the species’ optimal living temperature. A control group of 65 males and 27 females were kept at optimal temperatures of 30°C and 35°C.

After these treatments, males were paired off to mate with females. The results were dramatic: The control group was able to produce twice as many offspring as the males subjected to a heat wave, due to the precipitous drop in the latter group’s viable sperm count. The results were even more pronounced when beetles were subjected to multiple heat waves. Those males fathered fewer than one percent the number of offspring produced by the control group, resulting in “almost complete sterility in males,” the team said.

The females that were exposed to heat waves were about as reproductively successful as the control group of females. However, a group of females that mated with males before a heat wave were indirectly affected because the viability of the sperm inside them was reduced by the high temperatures.

The negative effect on fertility was not confined to beetles that directly experienced the heat waves—their offspring also suffered from higher rates of infertility and shortened lifespans.

“Reproductive potential of male offspring was significantly reduced if they had been fathered by males or sperm that had previously experienced thermal stress, and offspring lifespan was shortened if fathers had experienced a heat wave,” Sales and his colleagues said.

Read More: Cyborg Sperm Could Dramatically Improve Infertility Procedures

The study focused on so-called “cold-blooded” ectotherms, which are organisms that, unlike humans, require external heat sources to control their body temperatures. Because they are so sensitive to thermal shifts, ectotherms are particularly threatened by climate change.

But previous research has shown that endotherms, organisms that can generate heat internally like mammals, also suffer reduced fertility in abnormal heat. A 1970 study in the Journal of Animal Science found that male mice exposed to elevated temperatures were about 75 percent less fertile in the near term, though their sperm viability improved once they were removed from heat stress.

A 2018 study published in Demography modeled 80 years of birth data in the US, and found that heat waves correlated with decreased birth rates nine to ten months later. However, there is still debate over the degree to which heat influences human male fertility.

Regardless, the new study shows that hot temperatures mean less fertility for insects, which is still bad news for humans.