Sex may be the secret to good health and a longer life, according to a recent study on insects.

Research by the University of Michigan found that fruit flies with better sex lives live longer. The findings were published in the journal Science.

Researchers found male fruit flies that perceived sexual pheromones of their female counterparts -- without the opportunity to mate -- experienced rapid decreases in fat stores, resistance to starvation and more stress. These sexually frustrated flies also lived shorter lives.

However, flies that mated often received the benefits of having the negative effects of health and aging partially reversed.

"The cutting-edge genetics and neurobiology used in this research suggests to us that for fruit flies at least, it may not be a myth that sexual frustration is a health issue. Expecting sex without any sexual reward was detrimental to their health and cut their lives short", senior author Scott D. Pletcher, Ph.D, professor in the Department of Molecular and Integrative Physiology at the U-M Medical School and research professor at the U-M Geriatrics Center, said in a statement. "Our findings give us a better understanding about how sensory perception and physiological state are integrated in the brain to affect long-term health and lifespan."

Researchers used sensory manipulations to give the common male fruit fly the perception that they were in a sexually rich environment by exposing them to genetically engineered males that produced female pheromones. They were also able to manipulate the specific neurons responsible for pheromone perception as well as parts of the brain linked to sexual reward (secreting a group of compounds associated with anxiety and sex drive).

"These data may provide the first direct evidence that aging and physiology are influenced by how the brain processes expectations and rewards," Pletcher said. "In this case, sexual rewards specifically promoted healthy aging."

According to a press release, fruit flies have been a powerful tool for studying aging because they live on average 60 days yet many of the discoveries in flies have proven effective in longer-lived animals, such as mice.