Spain ranks fourth as the best place to work and live, according to people who participated in the latest HSBC Expat Explorer Survey, published on Thursday.

This is the best position since the survey began 12 years ago. Last year, Spain ranked 13th. This year Switzerland, Singapore and Canada were ahead of Spain, which was followed by New Zealand in the Top 5 category.

The good weather was described as a major determining factor by 39% of respondents

The study focuses on people over 18 who live and work outside their home country. The British company used feedback from 18,059 individuals who answered 27 online questions between February and March of this year.

Indicators are divided into three broad groups covering living standards, professional and financial goals, and opportunities for children.

According to this classification, there are three main reasons that make Spain a top destination: personal safety, the weather, and quality of life.

As for safety, 61% of respondents said they felt more protected in Spain than in their home country. The good weather was described as a major determining factor by 39% of respondents, while 56% underscored quality of life as the main reason they chose Spain.

This year Switzerland, Singapore and Canada were ahead of Spain

The report also highlights that 83% of foreign residents felt their overall wellbeing had improved in Spain, and that 62% had decided to extend their stay.

The weak points are on the professional and financial fronts. Respondents said that Spain is not the best place for career advancement or to make a good salary. The average annual salary of respondents living in Spain is €36,000, around half of the global average of €67,300.