Last year, workers at a resort near a nature preserve in Western Australia discovered an olive python with an odd, bulging body. They soon got an even bigger surprise when the 4 meter (13 foot)-long snake vomited up another python that was about the same size!

Olive pythons eat birds, mammals, and other reptiles by swallowing them whole. The snakes first nab prey with their recurved, or fishhook shaped, teeth. Next, the pythons coil themselves around the animals, squeezing them until their hearts stop beating. Then it’s down the hatch. A python’s double-jointed jaws can open a full 180 degrees, allowing it to gulp down prey up to five times the width of its own head.

To swallow, the snake uses its flexible jaws to alternately dig its right and left teeth into its meal. With this back-and-forth motion, “the snake’s jaws ‘walk’ down the prey’s body,” says Travis Anthony, a herpetologist — a scientist who studies reptiles and amphibians — at the Virginia Herpetological Society. This action also coats the prey in saliva to help it slide down the snake’s throat. The python can still breathe when its mouth is full, thanks to its glottis. This tube-like opening in the bottom of a snake’s mouth connects to its windpipe.

So, after all that hard work, why did the python in Australia regurgitate its slithery snack? Snakes may cough up a meal if they feel threatened or if it’s too large, says Anthony. In this case, the python really may have bitten off more than it could chew.