A trip to the bathroom turned into a freaky near-death experience for a Thai woman when she was attacked by a python hiding in the toilet, Coconuts Bangkok reported.

Rampeung Onlamai, of north Bangkok, had just finished showering at home last Monday when a python emerged from the toilet, sank its fangs into her right hand and tried to drag her into the depths of its toilet lair.

The 57-year-old grabbed a nearby broom and was able to fend off the reptile until her daughter ran in and pried its head from Onlamai's hand.

The snake slithered back into the toilet.

Onlamai suffered a gash to her hand and received 20 stitches at a local hospital, according to Coconuts Bangkok.

Samkok district police said they are working to capture the python from the toilet so the family can continue using the bathroom.

Pythons are native to sub-Saharan Africa, Australia and parts of Asia, including southern China, India, Nepal, Sri Lanka and the Philippines, according to the Deccan Chronicle.