As Western Europe continues to grapple with an influx of immigrants and refugees, its central and eastern European neighbors are dealing with the opposite problem: keeping citizens from leaving. As their best and brightest flock westward to settle in the European Union’s wealthier states, eastern nations have seen economic malaise and steep population declines. In turn, anti-emigration sentiment has gained steam. In late October, Lithuania elected a fringe anti-emigration party, the Farmers and Greens Union, to head its parliament.

That result should not have been surprising. The country had seen around ten percent of its population leave since it joined the European Union in 2004. Weeks before, the Visegrad group of central European nations—Czech Republic, Hungary, Poland, and Slovakia—convened a summit to call for more action to prevent the emigration of younger citizens. And over the summer, Latvia launched a campaign to lure its diaspora home, using the tagline “I want you back.” It joins Poland, which developed a “Return” program, offering housing, employment, and health-care assistance to homecomers, while Hungary promised free flights and cash to woo its departed.

Since the early 1990s, some 20 million of central and eastern Europe’s most talented workers have left. And they have largely headed for Western Europe—pulled by its prosperity, pushed by stagnant postcommunist economies at home, and assisted by the EU’s open border policy. But mass migration has not only energized anti-immigrant and anti-EU groups in the West, it has also hollowed out the economies of eastern European periphery.

Europe’s emigration crisis is driven, in part, by Brussels’ ideological attachment to the free movement of labor—along with its goal to liberalize a diverse continent with a single market approach. But, given that February of this year marked the 25th anniversary of the Maastricht Treaty, the pact that created the single market, the downsides of a one-size-fits-all strategy are becoming all too apparent.

As European borders fell away with the EU’s eastward expansion in the 2000s, many of the people in eastern states voted with their feet, rationally choosing the higher wages and stronger governance of Western Europe. Even today, net average monthly salaries in the eastern neighborhood are, broadly speaking, no more than half of what is available in France, Germany, and the United Kingdom.

Since the early 1990s, some 20 million of central and eastern Europe’s most talented workers have left. And they have largely headed for Western Europe—pulled by its prosperity, pushed by stagnant postcommunist economies at home, and assisted by the EU’s open border policy.

Central and eastern Europe’s low-cost growth model, which sought to attract global manufacturing firms to the region’s cheap labor supply, brought billions in foreign direct investment and millions of factory jobs to the region. But it is now beginning to show its age. The reliance on low-wage industries is proving unsustainable, as workers of all skill sets have emigrated for higher-paying jobs across Europe. Outcompeted, firms are now facing severe labor shortages, which is also weighing in on regional productivity growth. In Hungary, for example, the ManpowerGroup’s Talent Shortage Survey for 2016–17 found that over 50 percent of firms had difficulties finding staff; meanwhile, record numbers of Hungarians are now reportedly going abroad for work.

In the long term, this brain drain will make it difficult for eastern nations to maintain a competitive edge. In the past decade, Latvia, Lithuania, Poland, Romania, and Slovakia have seen between six and nine percent of their highly educated young professionals leave, according to a European Commission report released early last year. The bulk of émigrés do not return home. Nations are deprived of the skills and knowledge required to push their economies into more lucrative tertiary industries, while remittance payments have been largely insufficient to compensate for the loss.

To complicate matters further, populations are set to shrink and age as the childbearing population departs. The ratio of elderly dependents to the working age population is inching up across the region, straining state coffers with high welfare spending. Since joining the EU in 2004, Poland has lost over two million to its western neighbors, which has accelerated the greying of its population. In the early 1990s, the nation’s old-age dependency ratio—the population aged 65 and over as a percentage of the population aged 15 to 64—was around 15 percent. Now, that figure is closer to 20 percent, and will likely double to 40 percent by 2040, according to Eurostat.

Emigration has, on average, cost nations in the region about seven percentage points of lost real economic growth, with a potential nine percent loss to total output expected by 2030 should current trends continue, according a 2016 International Monetary Fund study. Its research—which covers a mix of EU and non-EU central and eastern European states—also found that emigration may have slowed continental income convergence. The analysis suggests that in the absence of skilled emigration, the gap between these countries and the EU average income per person would have been around five percentage points smaller.

In the Baltic states, demographic decline has additional security implications. Emigration, as a 2015 U.K. Ministry of Defence report warned, “reduces the manpower available for recruitment into the armed forces in the event of crisis.” Already, Estonia, Latvia, and Lithuania have a combined population of only six million. The prospective shortages come at a particularly tense time, with the threat of a resurgent Russia and uncertainty over the U.S. commitment in the region.

Of course, joining the EU did lead to windfall gains for the eastern neighborhood: free trade deals, billions in development funding, billions in new foreign direct investment, and an enhanced soft power presence around the globe. But even if the EU’s globalist approach does drive prosperity on the continent as a whole, such growth has not been balanced.

In hindsight, Brussels should have delayed, or at the very least, staggered eastern European accession into the bloc’s freedom of movement pillar—at least until wages, economic opportunities, and governance in central and eastern Europe were on par with those in Western Europe. Alternatively, Brussels could have maintained some administrative barriers to movement, such as requiring work permits or instituting points-based immigration systems to avoid large movements across borders. With Albania, Bosnia and Herzegovina, Kosovo, Macedonia, Montenegro, Serbia, and Turkey all in the queue for prospective EU membership, it is not too late to introduce such a system.

Setting the right level of immigration might, however, prove arbitrary and difficult, not to mention insufficient for stemming flows, which may persist so long as the EU keeps expanding and life seems better in the west than in the east. Brussels also finds checks on free movement unpalatable: a white paper presented by the European Commission on March 1 outlined five future scenarios for the bloc, involving a spectrum of different integration levels—and none envisaged anything less than the single market of goods, services, capital, and labor.

What Brussels can do, as the IMF suggests, is allocate additional funds to compensate for lost economic growth from out migration. It can also provide more aid for the region’s universities, for research and development, and for high-skill industries to help central and eastern European states retain and attract skilled workers and students. Meanwhile, continued long-term pressure to democratize and reduce state corruption will be integral to lessening migratory push factors.

The EU has suffered under its own utopian drive to standardize policymaking across economically and geopolitically unique entities—as the eurozone and migrant crises can attest. But for the sake of its eastern members, it is time that Brussels broke some taboos and reconsidered the viability of fully free movement. In central and eastern Europe, the strain of mass emigration illustrates how Brussels’ defense of liberal values must begin with introspection—and end with reform.