Doctors in India were stunned when they pulled out a 6-foot-long tapeworm living in a man’s stomach.

One of the doctors who treated the man said it was the longest worm he's ever seen. Live Science reports.

>> Read more trending news

In a report published by The New England Journal of Medicine, the 48-year-old man complained of abdominal pain for two months before going to the hospital.

Specialists performed a endoscopy in his gut, which showed a worm curled up in the upper part of his small intestine.

To remove the worm, doctors had to pull it up through the man’s mouth, according to the report. The worm was fully intact in his body, but doctors said most worms are found in segments.

Doctors then gave the man anti-parasitic medication to kill any remaining tapeworms.

People can become infected with tapeworms if they ingest the eggs which are found in raw or under cooked pork, according to the National Library of Medicine.

The eggs of the tapeworm can form cysts throughout the body, even the brain, and when hatched can grow to be longer than 11 feet, Live Science reports. Most people do not have symptoms, but some can experience abdominal pain.