This is no April Fool's joke: Zebras have stripes because many biting insects avoid black-and-white striped surfaces, according to a new study.

Writing in the April 1 edition of Nature Communications, a team of researchers led by Tim Caro, a professor of wildlife biology at University of California, Davis, reports their analysis of several long-held theories to why zebras have stripes.

In the more than 120 years that have passed since Charles Darwin and Alfred Russle Wallace debated why zebras are striped, a number of theories have emerged. These include:

  1. Zebras are striped as a form of camouflage
  2. The stripes visually confuse predatory carnivores, lowing likelihood of attack
  3. Stripes are a method of regulating body heat
  4. The stripes play some type of social function
  5. Stripes act as a deterrent to attacks by exoparasites such as biting flies.

Caro and his collaborators tested all five of these leading zebra stripe theories, ruling out all but the last one.

To do this the team mapped the geographic distribution of the seven different species of zebras, horses, asses and their subspecies. The thickness, location and intensity of stripes on these animals was also recorded. Then, the researchers compared this data with additional variables including the animals' proximity to woodland areas, nearby ranges of large predators, temperature, and geographic distribution of biting flies such as horseflies and tsetse flies.

The researchers examined where these variables overlapped with the location of stripped animals. Based on their evaluation, all of the hypotheses were ruled out except for avoiding biting flies.

"I was amazed by our results," Caro said in a statement. "Again and again, there was greater striping on areas of the body in those parts of the world where there was more annoyance from biting flies."

The theory that stripes could be a form of bug repellant was elevated by a 2012 study that suggested that biting flies are most attracted to dark surfaces and repelled by lighter ones, but that striped surfaces seemed to confuse the biting flies more of all.

However, that study did not make clear why more animals are not stripped, if striped patterns are so effective at deterring biting flies. Caro's study attempts to answer this question through geographic analysis.

After examining their data, his team found that there was a strong association with geographic areas where striped animals live and where biting flies also tend to thrive for months on end.

"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 told NBC News.

Caro said that the research provides ecological validity to the biting fly hypothesis, which will open the doors to future scientific inquiries into why biting flies are distracted by striped patterns and why zebras, in particular, are so vulnerable to biting flies.