BRUSSELS — European Union and Turkish leaders celebrated a “historic day” after sealing a widely criticized pact to send thousands of asylum seekers back to Turkey — a deal that will cost millions and require the rapid dispatch of thousands of experts to Greece to undertake the complicated task of making the plan a reality.

Amid broad smiles and congratulatory slaps on the back, the leaders announced that as of Sunday all migrants arriving in the Greek islands who do not qualify for asylum or whose applications are deemed “inadmissible” would be returned to Turkey.

In exchange, Ankara was promised fast-track procedures to get billions in aid to deal with Syrian refugees, unprecedented visa concessions for Turks to come to Europe and a re-energizing of its EU membership bid.

Turkish Prime Minister Ahmet Davutoglu, whose country is home to almost 3 million Syria refugees, proclaimed the agreement a momentous occasion.

“This is a historic day,” a beaming Davutoglu told reporters. “We today realized that Turkey and the EU have the same destiny, the same challenges and the same future.”

The arrival of more than 1 million migrants over the past year has plunged Europe into one of its biggest existential crises, not due to the numbers as such but rather the inability of the 28 member states to agree on the best way to tackle the challenge and maintain unity.

Friday's agreement was met with strenuous objections by humanitarian organizations.

The United Nations refugee agency had already highlighted deficiencies in Turkey's asylum system, and rights groups expressed concern about Ankara's media crackdown, rights abuses and long, bloody conflict with Kurdish separatists.

But such was Europe's desperation that the wealthy economic bloc was ready to declare Turkey a “safe country” for asylum seekers to be sent to, even though each year at least 1 of every 5 Turkish citizens who apply for asylum are granted it in some European countries.

When asked whether he agreed that it was a historic day, the man who chaired the summit, EU Council President Donald Tusk, said he wasn't sure.

“I'm not a prophet, but, for today, this is one of the most important achievements that we could have expected,” Tusk said.

For rights group Amnesty International, European promises that the pact would respect international law “appear suspiciously like sugar-coating the cyanide pill that refugee protection in Europe has just been forced to swallow.”

“The ‘double-speak' this deal is cloaked in fails to hide the European Union's dogged determination to turn its back on a global refugee crisis and willfully ignore its international obligations,” said John Dalhuisen, Amnesty's director for Europe and Central Asia.

Under the plan, the EU would pay to send new migrants arriving in Greece who don't qualify for asylum back to Turkey. This could include tens of thousands who might otherwise qualify but whose applications could be declared inadmissible because Turkey's likely new “safe country” designation means they should have applied for asylum in Turkey rather than trying to reach richer nations in the European heartland.

For every Syrian returned, the EU would accept one Syrian refugee from Turkey to ensure that no more people are added to the estimated 2.7 million Syrians already living in that country.

To make it all work, some 4,000 people would have to be deployed, including border guards, migration officers, translators and other staff, at a cost of $340 million in just the first six months, according to the EU's executive commission.

Greece would also deploy monitors to the Turkish coast, just 5 miles from the Greek island of Lesbos, a major entry point over the last year for people seeking sanctuary or jobs in Europe.

Up to $6.6 billion will have to be found for Syrian refugees in Turkey in coming years, and Europe must move quickly to open a new chapter in membership talks with Turkey by June and pave the way for visa-free travel for Turkish citizens, if Turkey can meet the benchmarks in time.

For German Chancellor Angela Merkel the agreement is a “clear message” to would-be migrants to stop taking to boats to cross the Aegean to reach Greece. Leaders hope the plan will see the crossings dry up within a month.

Still, the ultimate effectiveness of the pact was unclear because there are alternative routes to Europe, notably crossing the Mediterranean from Libya to Italy.

Merkel urged around 14,000 people camped in a muddy tent city in Idomeni on Greece's blocked northern border with Macedonia to “trust the Greek government and move to other accommodation where the conditions will be significantly better.”

Muhammad Hassan, a Syrian from the devastated city of Aleppo who had been looking for relief from the talks in Brussels, wondered why a continent of 500 million people could not deal with the crisis.

“Europe have only 1 million” migrants, Hassan said, speaking in broken English. “How come it's difficult?”

Comparing the EU to Lebanon, a nation of 5.9 million where millions of Syrians have fled, he added: “If a small country takes 3 million refugees ... how about Europe? It's not difficult.”