The Regimbartia attenuate, a water beetle, can often be found inhabiting the same rice paddies as local Japanese frogs. That got ecologist Shinji Sugiara of the University of Kobe wondering how the two species coexisted. The beetle, it would seem, would be a prime candidate for a snack from the frog’s perspective.

Sugiara decided to run some experiments to answer his question. He put the two in a bucket and observed. The frog, Pelophylax nigromaculatus, quickly gobbled up the tiny beetle and then it is up to its digestive system to kill the beetle. As frogs don’t have teeth, they depend on intestinal acids to break down their prey.

There are some insects that can cause the frog to spit them back out after being eaten, but that was not the case with the water beetle, which takes an altogether different approach. As Sugiara intently watched he saw something surprising. After a short period of time, sometimes in a matter of minutes, the beetle would suddenly appear exiting the frog’s sphincter.

The scientist says most frogs need a couple of days to defecate the carcass of their prey, but that the water beetle clearly seemed to have actively worked its way through the frog’s digestive tract and tickled or irritated its sphincter, opening it and allowing the beetle to crawl to safety.

Sugiara, who published his findings Monday in the peer-reviewed journal Current Biology, says the beetles seem to be unfazed by the ordeal, eventually extracting themselves from the frog’s excrement and swimming off to safety. Sugiara conducted the experiment with a number of beetles as well as other species of frog, he says that most (93.3%) were out of the frog’s belly within six hours.