It’s an ophidiophobe’s worst nightmare: being strapped in to a seat 40,000ft above ground with a snake slithering around your ankles.

However such a scenario nearly played out for hundreds of passengers on board a Qantas plane in Sydney, after a Mandarin rat snake was found in the doorwell of a plane bound for Japan.

Although the reptile was a mere 20cm long, the 370 passengers were forced to spend the night in a hotel, amid fears more snakes could be found on the craft.

Download the new Independent Premium app Sharing the full story, not just the headlines

The snake was taken to quarantine and euthanised “as exotic reptiles of this kind can harbour pests and diseases not present in Australia”, a spokeswoman told Guardian Australia.

The Mandarin rat snake is an Asian species which can grow to about 1.4m. It feasts on small rodents and is usually active at dawn and dusk.

A replacement craft was organised while the original plane was fumigated in case other reptiles were on board.

This isn’t the first snake-related incident to occur on a Qantas plane this year, after a three metre python clung to the wing of a Qantas flight from the northeast coast city of Cairns to Papua New Guinea in January

The python didn’t survive the flight, but had frozen to the wing when the plane touched down in Port Moresby. The wind whipping the snake against the side of the plane left a bloody smear according to passengers on the flight.