In Brussels, the European Union and Turkey have reached a deal aimed at stemming the massive flow of people into Europe. It will likely impact tens of thousands of migrants and refugees.

European Council President Donald Tusk tweeted that the sides unanimously agreed to terms.

At a news conference announcing the deal, Turkish Prime Minister Ahmet Davatoglu said, "The agreement today has a humanitarian dimension, because the main objective of all these efforts was to prevent the deaths of children, women, youngsters, in the Aegean sea or in different parts of our neighborhood."

Turkey stands to gain billions of dollars as a result of the agreement — money that Davatoglu said would go toward supporting migrants in Turkey.

It also gains visa-free travel into Europe for its citizens, in return for taking in migrants who have traveled to Europe.

Tusk, speaking at the news conference, said that starting Sunday, all migrants traveling illegally from Turkey into Greece will be returned to Turkey. Implementation of the deal is to be phased in gradually.

Reporter Lauren Frayer in Brussels tells our Newscast unit more about the outline of the agreement:

"The deal will essentially make Turkey a refugee buffer zone between Syria and Europe. Thousands of new migrants and refugees landing in Greece will be pushed back across the Mediterranean Sea to Turkey. There they'll have their asylum applications processed, for resettlement in any one of 28 European Union countries."Officials say it'll be a one-to-one trade-off — for every migrant returned to Turkey, a Syrian refugee will be granted asylum in the EU — up to an initial 72,000 people."In exchange, Turkey will get billions in EU aid, to pay in part for new refugee camps it'll have to construct. The EU has also agreed to accelerate talks on Turkey joining its union."

British Prime Minister David Cameron has said the plan would also be a step toward "busting the business model of these people smugglers, and so therefore breaking the link between getting in a boat and getting settlement in Europe."

One big criticism of the deal, as Lauren points out, is that it "only addresses resettlement of Syrians — what about all those Afghans, Iraqis, Eritreans?"

This plan, which EU leaders have framed as pragmatic, has been broadly criticized by rights groups and by migrants themselves.

"Let's not confuse desperation for legality when it comes to Europe's proposed refugee deal with Turkey," Amnesty International said in a statement. "Every government in Europe will have to declare its hand this week: does it uphold the right to seek asylum, or does it subordinate that right to horse trading with a country that has an inadequate record of respecting it."

Amnesty is calling for "large-scale resettlement of refugees to Europe and elsewhere." After the deal was finalized, Amnesty U.K. tweeted, "This is a dark day for the refugee convention, a dark day for Europe and a dark day for humanity."

Ahead of his meeting with EU leaders on Friday, Davatoglu batted back at the widespread criticism. "For us, for Turkey, [the] refugee is not an issue of bargaining, but an issue of values ... all humanitarian values, as well as European values," he said in comments to reporters, published by Anadolu Agency. "Turkey has received 2.7 million refugees, without any significant assistance from anywhere."

Meanwhile, the humanitarian situation for migrants stuck in Greece is growing more desperate.

Copyright 2016 NPR. To see more, visit