A Thai man is recovering in hospital after being attacked by a nine-foot (three metres) python while sitting on the toilet.

Attaporn Boonmakchuay suffered a three-inch (eight cm) wound after being bit on the penis by the snake which had crawled up through the plumbing.

The excruciating ordeal lasted half an hour before he managed to prise open the snake’s jaws and escape.

Mr Boonmakchuay described how he fought the snake as his wife sought help but, even after a neighbour came to his aid with a knife and rope, he only managed to free himself only when the python momentarily lost its strength.

Attaporn Boonmakchuayrecovering in hospital

Doctors said the victim’s injuries could have been worse

He said: “All of a sudden, while I was holding it, it began to lose some strength so I used my hand to prise open its mouth. Then the snake released its grip by itself.”

The 38-year-old needed stitches but medical staff say that he should make a full recovery.

A doctor from the Chachoengsao hospital, near Bangkok, said that victim was “lucky”, adding: “if the bite had gone into the urinary tract it would have been a big problem.”

Rescue workers managed to eventually release the snake after using hammers to free it from the toilet.

Large snakes are common even in urban areas of Thailand, particularly during the onset of the rainy season when they leave flooded areas for drier ground.