A New York woman who was prepared for a long battle against brain cancer got some shocking news when doctors finally opened up her skull. 42-year-old Rachel Palma had been experiencing some bizarre symptoms that prompted doctors to perform a scan of her brain, and when the images came back they appeared to show a brain tumor had taken root. The reality was somehow even more frightening.

As WCYB reports, doctors spotted a lesion that looked a whole lot like a marble-sized tumor. Palma and her family prepared for the seemingly inevitable fight against the disease, which was to include surgery followed by rounds of chemotherapy and radiation. That’s when doctors discovered that it wasn’t a brain tumor at all, but a parasite.

When the surgeons operated on Palma’s brain they found that there was no tumor at all. The lesion that appeared on scans of her brain was actually a firm lump that didn’t match any cancerous growth. Once the offending object was removed, doctors sliced it open to see its internal structure they were met with a horrifying sight.

“A baby tapeworm came out of that lesion,” Dr. Jonathan Rasouli, chief neurosurgery resident of the Icahn School of Medicine, told WCYB.

The good news is that once the parasite was removed, Palma didn’t require any further treatment as she would have in the case of a cancer growth, but just how she managed to get a parasite into her brain remained a mystery. It’s rare, but humans can contract parasites by consuming tiny tapeworm eggs, which can be spread from the feces of a person who has parasites in their gut.

You can mitigate your risk of a parasite infection by ensuring your fruits and vegetables are well washed before eating, and that all meat is thoroughly cooked before consuming it.

Palma says she’ll never know how she became infected with the parasite, but her symptoms were relieved after it was removed. She’s now “basically cured,” she says.