Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

For years, scientists have debated the evolutionary reason behind a zebra's stripes. Are they: a. Costumes for courtship? b: Camouflage to confuse lions and other predators? c: A natural way to cool off? d: Bug repellent?

If you answered "d," you'd win the prize, at least in the eyes of Tim Caro, a biologist at the University of California at Davis. He and his colleagues report in Nature Communications that the geographic range of zebras and other horsey species with stripes overlap nicely with the range of bloodsucking flies.

"It settles the question pretty well, in terms of trying to understand the evolution of striping in horses, zebras and asses," Caro told NBC News.

No, this is not an April Fool's joke.

Century-old debate

Researchers have looked for novel ways to settle the question ever since Charles Darwin and Alfred Russel Wallace started the argument in the 1870s.

All four of the hypotheses listed here, a through d, have been proposed. But a couple of years ago, the bug-repellent idea got a boost when researchers built horse mannequins, painted them in a variety of patterns, coated them with sticky stuff, and found that horseflies seemed to avoid landing on the fake horses that were painted with black and white stripes.

This wasn't an April Fool's joke, either.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The proposed explanation was that the flies preferred to land on dark surfaces. Such surfaces reflect the kind of polarized light that reminds the flies of the water or mud where they breed. Light surfaces aren't as attractive, but dark-and-light patterns are even worse — perhaps because such patterns confuse the flies' navigational sense.

There was one big question about that research: Would the fly-repellent effect really make a difference in the evolution of species? If stripes were so beneficial, why don't all horses have them?

Mapping stripes, and bugs

To answer that question, Caro and his colleagues created a detailed map charting the ranges of striped vs. non-striped species and subspecies. Then they worked on a map for the bloodsuckers that targeted those species — specifically, tabanid biting flies and tsetse flies. That map charted the environmental conditions that favored the flies' propagation, such as temperature and humidity.

The researchers found a significant association between the areas with conditions where such flies could be active for several months at a time, and the areas where the striped animals tended to do well.

"I was surprised myself to see, again and again and again, greater intensity of striping on species and subspecies where we have this biting fly annoyance for months," Caro said.

Similar maps were developed for the other potential evolutionary factors, such as the geographical range of lions, but the correlation wasn't nearly as consistent.

The 'why' of stripes

Biologists who buy into the bug-repellent hypothesis say that, all other things being equal, striped animals would have an evolutionary advantage because they wouldn't suffer from the loss of blood, reduced weight gain and lowered milk production that's associated with bug bites. Tsetse flies are also associated with the transmission of diseases.

"There are a lot of them, such as sleeping sickness, equine anemia and equine influenza," Caro said.

Warding off flies is particularly important for zebras because they have such thin coats of hair. "It's clear that the flies can get through that hair and get to the skin," Caro said. That's not the case for other, thicker-coated species that share the zebras' habitat, such as antelopes.

Caro will still have to persuade the wider world that the bug-repellent effect is the primary factor behind the evolution of stripes, rather than a, b or c. Other research has lent support to those alternative explanations, or even a combination of explanations. But at least one outside expert on animal behavior, the University of Manchester's Matthew Cobb, was impressed.

"Nice paper!" Cobb told NBC News in an email.

In addition to Caro, the authors of "The Function of Zebra Stripes" in April's issue of Nature Communications include Amanda Izzo, Robert C. Reiner Jr., Hannah Walker and Theodore Stankowich.