Luis Ortiz, 26, got the worst headache of his life and was rushed to the hospital, where doctors discovered he had only 30 minutes to live and required emergency brain surgery, CBS San Francisco reports. Doctors did a brain scan, which revealed that Ortiz had a live tapeworm larvae in his brain that was blocking circulation inside his brain, according to CBS.

"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?" Ortiz said.

CBS Sacramento reports that there are six types of tapeworms that can infect humans, and they usually come from undercooked meat or by eating food prepared by someone who is also infected.

"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," he said.

Read more at CBS San Francisco.