BRUSSELS — The European Union and Turkey reached a deal Friday to return new asylum seekers who arrive in Greece from Turkey, as soon as Sunday, a long-awaited and significant step in the bloc's effort to deal with the migrant crisis that has left tens of thousands of people in squalid conditions.
The leaders of the 28 nations in the bloc and Prime Minister Ahmet Davutoglu of Turkey approved the accord after two days of talks and over strenuous objections from humanitarian groups, who said the deal violated international law on the treatment of refugees.
The accord with Turkey represents a moment of painful compromise for Europe. Turkey has taken an authoritarian turn under President Recep Tayyip Erdogan, and Europe was forced to accept some Turkish demands to gain its cooperation in stopping the large numbers of people using the Aegean Sea to reach Greece.
Confirmation of the deal came from Donald Tusk, the president of the European Council, who oversees summit meetings. There was "unanimous agreement between" all leaders with the Turkish prime minister, Tusk wrote on his Twitter account.
Putting this massive and delicate operation, which does not call for migrants already in Greece to be sent back, into effect over the course of a single weekend would be difficult. European officials wanted to quickly put the measure in place to prevent a rush of migrants seeking to reach Greece before the deal goes into effect, although the exact cutoff date had not been formally established. But Greece currently lacks the infrastructure to ensure that migrants are given a fair hearing before they are sent back to Turkey, according to European officials.
The agreement will be welcomed by Chancellor Angela Merkel of Germany, who helped develop the plan at a time when much of the Continent, and a substantial portion of her own country, had turned against her policy of taking in almost unlimited numbers of migrants.
The negotiations hinged on incentives for Turkey, which is not a European Union member, to take on the job of housing more migrants, many of whom are fleeing the bloody conflict in Syria.
The deal calls for Turkey to receive about $6.6 billion in aid to help organizations look after the nearly 3 million migrants already in Turkey, promises of visa-free travel for its citizens in most of Europe, and the eventual resumption of negotiations with Turkey on membership in the European Union.
The European Union also will resettle one Syrian from a camp in Turkey in exchange for each Syrian who used an irregular route to reach Greece.
A sticking point was ensuring that Cyprus did not veto a deal. It needed reassurances that there would be no immediate resumption of negotiations on European Union membership for Turkey, which has occupied the northern part of Cyprus since 1974.
As the talks stretched into Friday morning, Erdogan intervened from Ankara with a warning not to press his government too hard to provide better conditions for the far larger numbers of migrants currently in Turkey.
"At a time when Turkey is hosting 3 million, those who are unable to find space for a handful of refugees, who in the middle of Europe keep these innocents in shameful conditions, must first look at themselves," Erdogan said in a speech broadcast on television.
Although the deal represents a meaningful step in the effort to bring the migrant crisis under control, it is unclear whether migrants will look for other options, rendering the agreement as just a temporary fix.
"The bigger headache will be when the smugglers start rerouting migrants to Italy through Libya because you've got a failed state there, so no real government to make a deal with," said Guntram Wolff, the director of Bruegel, a research organization in Brussels.