Scientists have found a bizarre food triangle between three different organisms lurking deep in the Peruvian Amazon.

The cast of characters includes a yellow parasitic plant that bursts forth like boils from tree bark, a caterpillar that feeds on that plant, and an ant that drinks the sweet liquid that the caterpillar produces in a special gland near its neck. And at least one of these critters seems to have evolved specific adaptations that allow it to better take advantage of this complex relationship. [See Images of the Strange Amazon Love Triangle]

"It's really a weird relationship, I've never seen anything like it before," said Aaron Pomerantz, an entomologist who works with a rainforest expedition company at the Refugio Amazonas near the Tambopata Research Center in Peru.

Tree boils?

Pomerantz was walking in the jungle when he spied strange, yellow bulbs that looked almost like dot candy bursting from a tree trunk. When he took a closer look, he realized that a caterpillar was feeding on the yellow bulbs.

But it got even weirder. As the caterpillar gorged on the bulb, an ant seemed to be drumming on the caterpillar's back. This drumming motion spurred the caterpillar to secrete a sugary liquid from a specialized organ on its back, called the dorsal nectary organ, which the ant then devoured.

It turned out that the caterpillar and the ant had an "I scratch your back, you scratch mine" relationship. The ant does bodyguard duty, warding off spiders, wasps or other ants that eat defenseless caterpillars, while the caterpillar provides snacks for the ant, a relationship known as myrmecophily, Pomerantz said.

"It's multiple layers," Pomerantz told Live Science. "You've got a tree, you've got a parasite inside the tree, you've got caterpillars eating the parasites and then ants taking care of the caterpillar."

Mysterious relationship

Pomerantz emailed several botanists to see if any could identify the plant with the odd-looking bulbs, and they were all stumped. Then a few identified the bulbs as a rare parasitic plant in the family Apodanthaceae. These plants burst from a tree's bark only to flower and be pollinated, Pomerantz said. As for the caterpillars, they are the larvae of butterflies from the family Lycaenidae.

Story continues

As far as he knew, this is the first time anyone has documented this strange and intricate web of interactions before, Pomerantz added. [See a Video About the Weird Symbiotic Relationship]

Interestingly, when Pomerantz went back to film the strange interactions, he noticed a nondescript gray butterfly with a little yellow dot on its wing laying eggs on the tree. With its coloring, it seemed to blend into the background of the tree and its yellow-bulb interloper.

He said he suspects the caterpillar grows into the gray butterfly, and that the butterfly uses its camouflage coloring to hide from lizards and birds. In other words, both the larval stage and the adult stage of this butterfly species have evolved changes to best take advantage of the tree and its parasitic plant.

"This really points to this long-term relationship," Pomerantz said.

That's especially baffling, considering that the parasites emerge from the trees just a few weeks every year to be pollinated, he said.

Follow Tia Ghose on Twitterand Google+. Follow Live Science @livescience, Facebook & Google+. Original article on Live Science.

Copyright 2016 LiveScience, a Purch company. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.