Migrants wave after being transferred from the Aquarius ship to Italian Coast Guard boats in the Mediterranean Sea. June 12, 2018. (Kenny Karpov/SOS Méditerranée)

David Miliband is the president of the International Rescue Committee. He was the foreign secretary of the United Kingdom from 2007 to 2010.

President Trump’s Twitter attacks on the German government and its migration policy were inaccurate in many respects. Fact-checkers have rightly contested the suggestion of a migration-led crime wave — crime rates in fact have not been this low since 1992. Nor have the attacks diverted attention from America’s own trauma, the new low represented by the decision to separate children from their families at the U.S.-Mexico border.

But Trump’s attacks must not deflect attention from the fact that Europe needs to make a quantum leap in its approach to migration. The European Union identifies migration as a challenge and an opportunity. But fragmented policy, made too late, with insufficient sharing of responsibility and inadequate resourcing, is doomed to fail.

Over the past week, the shortcomings of E.U. migration policy have been laid bare. The Aquarius, a search-and-rescue ship operated by aid groups in the Mediterranean Sea, was refused safe harbor in Italy and Malta after rescuing 629 people, over a hundred of whom were children traveling without their parents, along with six women who were pregnant.

In the same week, the crew of a U.S. ship, the USNS Trenton, in the midst of carrying out routine operations off the Libyan coast, caught sight of an overcrowded rubber dinghy in distress. The sailors saved 41 lives. It is unknown how many were lost at sea. It took five days for the Italian government to agree to accept these deeply traumatized people and allow them to enter Europe, where they are entitled, under international law, to seek asylum.

In announcing his decision to refuse access to the Aquarius, the Italian interior minister, Matteo Salvini, tweeted “#chiudiamoiporti” — “close the doors.” That is a hashtag, not a policy, much less a strategy. Europe needs an organized, unified and documented approach to migration — both geographically and value-wise. A beggar-thy-neighbor strategy does not work.

In the days immediately following Italy’s decision, Spain agreed to welcome the migrants onboard the Aquarius to its shores. Since then, France has offered to host those of the group who wish to apply for asylum in France. While these actions are to be applauded, this piecemeal approach to migration in Europe is neither effective nor sustainable. Nor is it compatible with the E.U.’s reputation as a human rights leader.

Just two weeks ago, International Rescue Committee teams in Libya — now the main transit point for the perilous journey to Europe — responded to the needs of young men escaping from militia in Bani Walid. Such wanton violence is commonplace. Several were killed in that escape, and over 100 were wounded. But only one in five migrants who reach Libya ultimately come to Europe.

The 1951 Refugee Convention legalizes the right for people to claim asylum. This is a hard-won right that should be defended. People need a fast, efficient, consistent system for processing claims. Those who succeed in their claims need effective integration into their new homes. Those who do not qualify need to be safely and humanely returned to their country of origin.

An effective system in Europe requires the following steps:

First, E.U. leaders must finally reach a sensible compromise on the reform of the so-called “Dublin regulation,” which in its current form dictates that the country where refugees and asylum seekers first arrive is the European country which must take responsibility for them. But it is unfair and short-sighted to expect Italy, Greece and Spain to be responsible for all those who make it to the E.U. All E.U. countries must commit to sharing this responsibility.

Second, there is now a real window of opportunity for European leaders to agree on a missing piece in the E.U.’s migration system: an effective refugee resettlement program. This involves the organized and planned transfer of refugees to a safe country, as opposed to leaving them to find their own way to safety.

According to the U.N. Refugee Agency, there are 1.2 million vulnerable refugees in need of resettlement. The United States, long the standard bearer on resettlement, has regrettably pulled back the welcome mat. It is now up to Europe to take the baton. After two years of negotiations, E.U. ambassadors will meet on Wednesday — fittingly enough on World Refugee Day — to discuss an agreement on the first ever E.U.-wide resettlement framework. They must not waste this opportunity.

Third, refugees are different from economic migrants. Asylum seekers and refugees have legal rights that go beyond those for whom home is safe but undesirable. But legal economic migrants have long been part of the fabric of Europe’s history, and many European countries suffer from a demographic challenge that requires more migration, not less. The commitment of the E.U. to a new entry/exit system for all those entering or leaving the continent makes sense. So does its commitment to the economic development of its neighbors to the south and east. These are not quick fixes, but they are the right fixes.

The current phase of globalization since the financial crisis has been marked by inequalities, insecurities and instabilities. The movement of people poses its own challenges, alongside flows of capital and technology. But it is wrong to say it is unmanageable or that walls will be the remedy. The richest countries in the world should be setting a positive example.

This was produced by The WorldPost, a partnership of the Berggruen Institute and The Washington Post.