A small, non-venomous garter snake caused panic on a Swiss train Wednesday, when it slithered loose, prompting all 450 passengers to unboard as police hunted for the reptile.

Police in Bern ended up finding the 50-centimetre-long black snake in a ventilation shaft, according to reports.

The early morning train was en route to the northern city of Basel from Bern when an alarmed passenger noticed the reptile in a carriage and told staff, according to Agence France Presse.

Donatella Del Vecchio, a spokesperson for the SBB national rail company, told AFP the snake was probably brought on board by a passenger and had not slithered its way onto the train.

Del Vecchio said the 450 passengers were transferred to another train that left around half an hour later.