A college senior was shocked to find that a living parasite had lodged itself in his brain, giving him less than an hour to live, according to CBS News.

Luis Ortiz, 26, was visiting home for a while before the start of his senior year at Sacramento State. All of a sudden, he reported suffering from one of the worst headaches he ever felt, and his mother immediately called 911.

When he arrived at the hospital, doctors scanned his brain and found the larvae of a tapeworm, which was blocking the flow of fluids in his brain, Palm Beach Post reported.

The doctors said that Ortiz had only 30 minutes to live and emergency surgery had to be done immediately. They used a tool with a camera on the end to remove the wiggling parasite from his head.

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

Doctors said that the parasite might have entered his body after he consumed raw pork, swam in a river or visited a developing country, according to Newsy.