NAPA (CBS SF) — A 26-year-old Napa man is recovering after a brain scan revealed he had a live tapeworm in his brain and required immediate surgery.

Luis Ortiz was just about to begin his senior year at Sacramento State when he was visiting his mother in Napa in August, and got the worst headache of his life.

Luis’ mom called 9-1-1, and paramedics rushed him to Queen of the Valley Medical Center, where the doctor later told Luis he had only about 30 minutes to live.

Luis went into a coma, and doctors used a tool with a camera to perform emergency brain surgery, and discovered the larvae of a parasitic tapeworm that had formed in a cyst blocking off circulation inside Luis’ brain.

“The doctor pulled it out and he said it was still wiggling, and I’m like ‘ugh, that doesn’t sound too good.’ Like, what are the odds I’d get a parasite in my head?” Luis said.

Doctors told Luis there were a few ways for the parasite to get inside his body.

“They told me it was uncooked pork or if I went swimming in the river or if I’ve been to a third world country and I was like, ‘I haven’t done any of that recently.’ But I don’t know how long that worm was in my head for,” Luis said.

Luis says he is more anxious than ever to finish college, and get on with his life.

“It’s probably more gratifying to me to be living, because if I would have waited a little bit longer, then I probably wouldn’t be here right now,” Luis said.