November 6, 2015 12:16 PM EST

After experiencing severe headaches and vomiting, a California man was found to have a live tapeworm inside his brain.

The man, 26-year-old Luis Ortiz, was rushed to the hospital by his parents after blacking out. Doctors saw in X-rays that his brain was swelling and that the worm was inside of a cyst, the L.A. Times reports. A surgeon was able to perform a very complicated and delicate surgery to remove the entire cyst without bursting it, which could lead to infection. When the surgeon pulled it out, the worm was apparently “still wiggling.”

It’s unclear how Ortiz caught this tapeworm, but it likely came from something he ate (perhaps uncooked pork) and moved to his brain from another part of his body. The ordeal led to some memory loss, but after rehab and cognitive therapy, Ortiz has now been released from the hospital.

[L.A. Times]

Contact us at letters@time.com.

Read More From TIME

Related Stories

EDIT POST