A California man’s trip to the emergency room likely began when he ate fish carrying tapeworm larva.

He told an emergency room physician he had a liking for raw fish – specifically, salmon sashimi.

It’s what the 30-year-old man, from Fresno, California, suspected had landed him in the bathroom with stomach cramps and bloody diarrhea.

But what he did not anticipate was the moment he spotted something hanging from his rear end, and he naturally assumed the worst.

“He was like, ‘Oh my goodness, my guts are coming out from me,’ ” said Kenny Banh, the emergency physician at the University of California at San Francisco, in Fresno, who treated him. Banh recounted what the man told him on the podcast “This Won’t Hurt A Bit” this month.

He gave it a pull, Banh said, and it kept coming.

“He picks it up and looks at it and what does it do? It starts moving,” he said. “He was like, ‘That’s a worm.’ “

It was a Monday in August 2017 when the man showed up in the emergency room of UCSF Fresno’s Community Regional Medical Center clutching a plastic grocery bag and asking doctors to treat him for tapeworms – parasites that can invade the digestive tract of animals and humans.

Banh opened the sack.

Inside, he said, was a cardboard toilet paper tube – with a tapeworm wrapped around it.

Banh said the worm was dead when he saw it but noted the man told him “it was alive when he pulled it out and it was wiggling in his hand.” Banh stretched it out on ER floor and measured it – all 5½ feet of it, he said in an interview Friday with The Washington Post.

Banh said it’s not certain which species of tapeworm it was or how long it had been inside the patient.

He said his patient was convinced he got the tapeworm from eating raw fish. Banh said given the fact that the man had not recently traveled or been drinking questionable water – and the fact that he said he ate sushi or sashimi almost daily – he is “almost positive” that the self-assessment was correct.

In January 2017, a study published in the Centers for Disease Control and Prevention’s journal Emerging Infectious Diseases noted that wild salmon caught in Alaska’s icy waters were found to be infected by a Japanese tapeworm known as Diphyllobothrium nihonkaiense.

They can grow up to 30 feet, the CDC said, noting they can live for years.

But aside from the sheer horror of it, tapeworms do not typically do much damage to their hosts.