BANGKOK (AP) — A Thai man is recovering from a bloody encounter with a 10-foot python that slithered through the plumbing of his home and latched its jaws onto his penis as he was using a toilet.

The 38-year-old told Thai TV Channel 7 that he struggled to remove the snake for 30 minutes Wednesday before he managed to free himself with help from his wife and a neighbor. After his wife tied a rope around the snake, Attaporn pried open its jaws before passing out.

Emergency responders dismantled the bloody toilet and released the snake into the wild.

The 38-year-old victim suffered an eight inch wound from the bite, but he is expected to recover.

“He has a really good attitude… even though his own wife and children were in shock. He’s been smiling and giving interviews all day from his bed.” hospital director Dr. Chutima Pincharoen said.

Emergency workers dismantled the Asian-style squat toilet, with the python still twined through it. The snake was taken away to be released back into the wild, according to an emergency responder cited by the newspaper Thai Rath.

Rescue workers removed the snake from the toilet using hammers to break the pipes and releasing it.