Turkey's president has derided Europe for not taking in more refugees just hours after the European Union announced a plan to give new aid and concessions to Turkey in exchange for stemming the flow of people across borders.
EU leaders meeting at a summit in Brussels into the early hours agreed to give "political support" for an action plan for Turkey to help it manage its refugee emergency, including easier access to EU visas and speeding up EU membership talks.
The hard part, though, is persuading Turkey to sign on, and raising money to make it work.
Diplomats said the EU package for Turkey could involve as much as 3 billion euro (£2.2 billion) in aid. But EU members have been slow in offering money for the migrant crisis overall, and divided over how much to help migrants and how much to help Turkey.
Discussions in Ankara will continue in coming days.
Turkish president Recep Tayyip Erdogan did not address the refugee deal but accused the EU of being insincere about Turkey's membership.
"We are far ahead of most EU countries but unfortunately, they are not sincere," Mr Erdogan said.
He sustained his anti-Western rhetoric, taking aim at those who suggested German chancellor Angela Merkel for the Nobel Peace Prize for opening Germany to so many refugees this year.
"We have 2.5 million refugees, no one cares," Mr Erdogan said.
Turkey hosts more refugees than any other country in the world. Hundreds of thousands are housed in refugee camps but many more are left to fend for themselves, leading some people to try their luck on the arduous journey to Europe, which has seen some 600,000 new arrivals this year.
After years of membership talks where the EU had the upper hand, now the EU is in a position of needing Turkey's help to ease the refugee crisis.
But EU leaders are concerned about authoritarian moves by Mr Erdogan towards the Kurdish minority and the media and justice system. Mr Erdogan's government has been pushing for a long time for looser visa rules, and that would be a vote-getter for his party in November 1 elections.
French president Francois Hollande said he "insisted that if there is a liberalisation of visas with Turkey ... it should be on extremely specific, controlled terms".
Ms Merkel, who is going to Turkey on Sunday, said the plan would mean that "on the one hand, Turkey enters into commitments with regard to the handling of refugees within its own country and, on the other hand, that we are ready to share the burden with Turkey".
She added: "We still must clarify the timelines, what should happen, when, how reliable our promises of support are, how reliable Turkey's promises of regulation are."
EU president Donald Tusk expressed "cautious optimism" about securing an agreement with Turkey on what he called "a demanding and difficult issue".
The deal "makes sense only if it effectively contains the flow of refugees", he told reporters after the summit.
The plan would see Turkey improve its asylum and documentation procedures and beef up border security. A draft was presented to Mr Erdogan last week during a visit to Brussels but has yet to be officially accepted by Turkey.