For years it was a source of labour: Latin America, from where Spain's poor colonial cousins flocked to work on its booming building sites. A decade on, the trend has gone into reverse.
Immigrants were among the first to lose their jobs when the boom was busted, and many headed home. Now qualified Spaniards are joining them.
With Spain's jobless rate above 25 percent, and 52 percent among the under-24s, they are looking not only north within Europe, but south to countries such as booming Brazil or Venezuela to find work and start companies.
Mercedes Martin, 29, is preparing to leave at the end of the year for Brazil, where she hopes to expand her web design and marketing business instead of scratching around for clients back in Spain.
"I find it difficult here because companies are not investing. They are too afraid and are cutting costs. In Brazil I think there are more opportunities," says Mercedes, who scouted around there last year.
"There is much more demand for qualified people there than here," especially with the football World Cup coming up in 2014 and the Olympic Games in 2016, she adds.
When Spain's building boom surged in the 2000s, so did its population: national statistics show that it rose by five million between 2002 and 2009 when the world financial crisis started to tell.
As a recession caused by the crisis gripped Spain, the tide of arrivals turned, and this year it has speeded up as jobs have got scarcer and many have fallen into poverty.
-- 'Those who insulted immigrants are now migrating' --
Spain had 50,000 more emigrants than immigrants in 2011, surging to nearly 138,000 this year up to September, according to the National Statistics Institute. Over 2011 and 2012 so far, 117,000 Spaniards have left the country.
In Las Palmas on the Canary Islands, Catherine Hernandez, 37, is preparing to leave her family for Venezuela -- an emerging economy whose left-wing leader Hugo Chavez is often treated with suspicion by Spanish newspapers.
A dual Spanish and Venezuelan national, Hernandez was born there to Canarian parents but returned to Spain 12 years ago and used her qualification in communications to work in local radio.
Now the Canaries have one of the highest unemployment rates among Spain's regions -- more than 33 percent -- while Venezuela, she believes, is booming.
"Here I have no work and Venezuela is flourishing. There are lots of opportunities to do lots of things," she said, citing a trip she made there a few years ago during which she found employment.
During Spain's boom last decade, "the Latin Americans were very badly regarded," she adds.
"People had the idea that immigrants were coming to steal jobs from the Spanish. Now those people who were denigrating them are finding themselves that they need to migrate. It is totally ironic, but I think it is positive."
-- The flight of the engineers, doctors, IT buffs --
In Europe meanwhile, many Spaniards are eyeing the well-trodden path to Germany. The Madrid branch of the Goethe Institut, a German cultural organisation, says enrollments for its language classes have surged 50 percent in two years.
"Since February 2011 we have noted a new and substantial group of students," says the institute's academic director in Madrid, Manfred Ewel, in a statement.
"Approximately 25 percent of our students are engineers, doctors or computer specialists who are looking for a professional future in Germany."
Others are taking a gamble in less prosperous corners of Europe.
Keen to work but also to learn English to improve his job prospects, Jaime Mora, 21, a draftsman from Madrid, jumped on a plane to Liverpool, northwestern England, because "the name sounded attractive".
"I chose it on a whim. I bought the ticket on a Tuesday and left the following Monday," he says. "The week after I bought the ticket, I felt cool. Then when I arrived and found myself all alone, it was harder."
Still, within a few weeks he had found a flat, a training school offering free English lessons and a job washing dishes in an old people's home to pay the rent.
In his English class, he says, 90 percent of the students are Spanish, including a psychologist, a biologist and engineers.
"The hardest thing is missing the people you love, your family and friends," he says of his departure. "But it's a lesson in life. At 21, I'm living away from home searching for a living. It's making me grow in leaps and bounds."
People queue outside a government employment office in the center of Madrid in October 2012. With Spain's jobless rate above 25 percent, people are looking to countries such as Brazil or Venezuela to find work.