Tax changes are believed to have forced thousands of expats to flee their new home in the Spanish sunshine.
Official figures show the numbers of European Union expats moving to Spain have fallen year-on-year since 2012 in line with the introduction of the new tax rules.
Expats have to declare details about their worldwide income and investments to the Spanish tax office.
The law was designed to halt bribery and corruption by local officials who were hiding their wealth offshore, but the wording of the law also netted expats.
The rules require expats to declare any overseas assets worth more than 50,000 euros.
Many expats who have failed to make the declaration are suspected to have left the country to avoid fines and other penalties.
18,000 British expats leave in a year
The National Institute of Statistics (INE), the independent government data body, found the expat population fell by 128,372 in 2015, which was a 9% drop.
Immigrants from Morocco and Romania are the largest foreign communities in Spain. Both number more than 700,000.
British expats are the third largest with 283,243, a 6% decrease from 2014 and the Germans fourth with a 7% fall to 130,911.
The total number of foreign residents in Spain in 2015, including expats, just topped 4.6 million out of a population of 46.5 million.
The number of EU nationals dropped by 5% to 1.835 million.
Overall, the population dropped by 0.2%, and for the first time, the number of deaths exceeded the number of births.
Spanish on the move for work
Besides a steady flow of expats leaving the country, Spaniards are also moving to other EU countries to find work.
In recent years, the Spanish economy has been dogged by recession and INE says the number of Spaniards abroad has surged by close to 60% since 2009.
Spanish consulates say 2.3 million nationals lived abroad on January 1, 2016 – 5.6% up year-on-year.
Most live in Latin America – with 439,000 in Argentina, 188,025 in Venezuela, while around 125,000 each live in Brazil, Cuba and Mexico. Around 102,000 live in Britain and 140,000 in Germany.
Statisticians point out registration with a consulate is voluntary and the figures may well be higher in some countries.