Whether fruit flies feel anything resembling emotion is hard to determine, but new research suggests they can experience a fearlike state.

“When a fly responds to a visual threat, it isn’t just a robotic reflex; there is some sort of internal state that develops,” said David J. Anderson, a biologist at the California Institute of Technology and an author of the new study, published in Current Biology.

The building blocks needed for emotion are called emotion primitives; these include persistence and scalability.

“If you’re hiking and hear a rattlesnake, your heart is going to pound and you experience fear long after the snake is gone,” Dr. Anderson said. “That’s persistence.”