Researchers have discovered some risky sexual behavior in some small marsupials. Competition to reproduce has led to a programmed suicidal response in male marsupials and, surprisingly, that’s been a good thing for the evolution of these animals.

Diana Fisher, from the University of Queensland, Australia, led the research which was published in the journal Proceedings of the National Academy of Sciences. According to Fisher’s research, some male marsupials, such as antechinus, a small insect-eating marsupial indigenous to Australia, New Guinea and Tasmania, will increase the level of stress hormones produced, during breeding season, which will ultimately lead to “total immune system collapse, hemorrhaging and infections” and death.

Suicidal reproduction, or semelparity, has been seen in other animals and insects. Many arachnids display this reproductive behavior and another famous example is the Pacific salmon. Suicidal reproduction has only been found in a few mammals, such as the Brazilian slender opossum.

It may not seem like an advantageous behavior for these animals, in terms of evolution or survival, but the researchers discovered it was a beneficial strategy for these marsupials. According to the research, male death, in other animals, may have been explained as a way to ensure the survival of the offspring, preventing starvation, but this suicidal behavior has its origins in sexual selection by females.

The researchers first ruled out suicidal behavior exhibited by male marsupials as an evolutionary response to a shortage of food. Mating seasons were shortened in accordance to a “prey peak,” meaning there was enough food to go around, but that then led to some intense competition among males. Interestingly, males rarely fight during the breeding season and Fisher and her team observed males, and females, sharing habitats.

According to the researchers, “More-predictable prey peaks were associated with shorter annual breeding seasons, consistent with the suggestion that females accrue fitness benefits by timing peak energy demands of reproduction to coincide with maximum food abundance. We demonstrate that short mating seasons intensified reproductive competition between males, increasing male energy investment in copulations and reducing male postmating survival.”

Prior to death, the marsupials engage in extreme sexual behavior, mating up to 14 hours and with multiple partners, over the course of several weeks, reports the Conversation. This behavior led to the evolutionary development of larger testes, as males do not produce sperm throughout their life. According to the researchers, this ability to store more sperm allows for better success for reproduction, “Males with larger testes and better endurance succeed. Females benefit by promoting this extreme sperm competition, because the highest-quality males father their young,” Fisher said in a statement.

For marsupials, males that sacrifice themselves have a better chance of passing on their genes. This behavior, as noted by Fisher, leads to a grisly death as “Males lose their fur and can develop ulcerations and gangrene.”