WHEN the financial crisis hammered Portugal’s economy, hundreds of thousands of its people left, taking advantage of the European Union’s rules on free movement to find work in countries that were hit less hard. Now Portugal is welcoming older people going in the other direction, not for jobs but for a warm, cheap retirement. Well-off baby-boomers are flocking to Lisbon, Sintra and the Algarve, drawn in part by Portugal’s tax exemptions on foreign income. Under its non-habitual-residency scheme, pensions from abroad can be drawn tax-free for a decade.

Bilateral double-taxation agreements are intended to ensure that income does not end up being taxed twice. But some countries, seeking to boost domestic demand by luring wealthy immigrants, have arranged matters so that they can avoid paying any tax on income earned outside their country of residence, such as pensions, capital gains and rent. To qualify, foreign pensioners who move to Portugal need only stick around for six months a year and register as tax-resident.

Portugal is not the only EU country where foreign pensioners can find a sweet deal. France taxes some pensions taken as a lump sum at 7.5%; with judicious use of private health insurance, pensioners can also avoid paying the social charges of 9.1% normally levied on pensions. Malta exempts pensions of up to €13,200 ($15,200) from tax altogether, with a flat rate of 15% above that. State pensions are often excluded from generous exemptions but Cyprus taxes all pensions at 5%, making it particularly attractive for retired civil servants. It also allows people to withdraw their entire pension pots as a lump sum tax-free.

Governments elsewhere are cross about being undercut. Portugal’s most vocal critics are the Nordics. Finland shredded its tax agreement with Portugal in June. If Portugal does not accept a draft deal letting Finland tax most pensions drawn by its retirees there by November, it will start doing so anyway in January. It estimates that it loses a mere €3m-6m a year in revenue to Portugal, but says that as a matter of principle it can no longer tolerate “tax refugees”. This is just sour grapes, says Pekka Pystynen, a retired former executive. Mr Pystynen spends his winters in his home in the Algarve and the summers at his cottage in Finland. The tax benefits were a bonus, he says, but the main draws were the weather and relaxed lifestyle.

Pensioners are important to Portugal’s tourism industry, which contributed over 17% to the country’s GDP in 2017. One job in five is linked to tourism. The average pension paid to Finns living in Portugal is around €3,500 a month. Since prices are a fifth lower than the euro-area average, that goes a long way. According to Sirpa Uimonen of the University of Helsinki, Finns living in the Algarve spend €14,700 a year on average, over 20% more than locals do.

Withdrawing from double-taxation agreements is rare. Denmark ended its deals with Spain and France in 2009, also because of rows about pensions. In the case of Portugal, other countries may follow Finland’s lead. Sweden’s finance minister has pressed to do so. More commonly, countries take matters into their own hands. France is about to start taxing French pensions that are paid abroad. And a new bilateral agreement means that Britain will soon start taxing British government-service pensions drawn in Cyprus.

Portugal’s generosity to retired foreigners has been criticised by locals. They pay up to 48% on their pensions; property prices rose by 10% last year. Extra demand from foreign buyers will not have helped. One political party, the Left Bloc, has proposed closing the pensions loophole. Retired foreigners may soon have to decide whether vinho verde and pasteis de nata are enough of a draw.