A hostage situation on a train in the west of Switzerland on Thursday night ended with the suspect killed in a police raid and the hostages safely freed, authorities said.

The hostage-taker was armed with an axe and a knife, and was speaking Farsi and English, Vaud canton police spokesman Jean-Christophe Sauterel said at a press briefing.

"At this stage of the investigation, the motives of the perpetrator are not known," he said.

The hostage-taker's identity, he added, was still not officially confirmed, and checks were being carried out.

The man was shot dead by a police officer after allegedly rushing at him with the axe.

A total of 15 hostages were taken -- 14 passengers and the conductor -- with the ordeal dragging on for nearly four hours, from around 6:35 pm to 10:30 pm (1735 GMT to 2130 GMT).

The suspect had forced the conductor of the train -- which was stopped near Yverdon -- to join the passengers, who alerted police to the situation.

Negotiations with the suspect took place in part via WhatsApp and with the help of a translator speaking Farsi, the predominant language in Iran.

Authorities ultimately decided to storm the train and executed a manoeuvre to keep the man away from the hostages, according to Sauterel.

Hostage situations are rare in Switzerland, but do occasionally occur.

In January of 2022, criminals took a couple and two employees of a company hostage in an attempt to gain access to vaults where precious metals were kept, but ultimately fled without the loot.

And in November of 2021, the director of a watch company and members of his family were taken hostage at his home, with the assailants stealing gold and taking off for neighbouring France.