Man survives vicious python attack while on toilet

This is the stuff of nightmares, but for one Thai man, it was all too real.

Attaporn Boonmakchuay, 38, was using a squat toilet when a 10-foot-long python slithered its way through the home's plumbing and used its powerful jaws to latch onto the man's genitals, according to The Associated Press.

Explore>>What to do if you're bitten by a snake

The man, along with his wife and neighbor, struggled for 30 minutes with the snake before he was freed. Attaporn passed out from the ordeal.

Explore>> Read more trending stories

The man was rushed to the hospital, where director Dr. Chutima Pincharoen said that he will recover from the attack and has been smiling and giving interviews all day.

Explore>>12-foot python found hiding in women's toilet at Australian park

Photos and video were taken as emergency workers removed the snake from the toilet. According to Thai news sources, the snake was released back to the wild.

Warning: Video contains graphic content

The Associated Press contributed to this report.