European leaders agreed a common position to put to Turkey's prime minister on Friday in a bid to clinch a vital deal to tackle an unprecedented wave of migrants and refugees that have fled to the continent.
The 28 states spent the day haggling over the proposal, under which Turkey would take all migrants from Greece to help curb Europe's worst migration crisis since World War II.
The deal would exact a heavy price including an acceleration of Turkey's long-stalled bid for EU membership, billions of euros in extra aid and visa-free travel for Turkish nationals.
Critics have raised concerns that the "one-for-one" deal could also violate international law and pointed to Ankara's human rights record.
"Agreement on EU position, @eucopresident will present it to Turkish Prime Minister before our EU Council tomorrow," Luxembourg Prime Minister Xavier Bettel tweeted, referring to European Council President Donald Tusk.
German Chancellor Angela Merkel said it was a "good opportunity to stop the business of human traffickers" involved in an unprecedented influx of 1.2 million people from Syria and elsewhere since 2015.
Merkel however insisted on "preconditions" and clear plans to deal with the logistics of processing thousands of asylum seekers on the Greek islands and sending them back to Turkey.
Prime Minister Ahmet Davutoglu said as he boarded a plane in Ankara that the proposed deal was "clear and honest" but added: "Turkey will never become an open prison for migrants."
He is due to meet Tusk, European Commission chief Jean-Claude Juncker and Dutch Prime Minister Mark Rutte at 0730 GMT before EU leaders meet again for final consultations expected at 1200 GMT, EU officials said.
A senior EU official said Tusk had a "common position" to put the Turkish premier, adding that he had "understood everyone's red lines" for the negotiations.
Italian Prime Minister Matteo Renzi said it would be an "intense" day.
The migrant crisis has left Europe increasingly divided, with fears that its Schengen passport-free zone could collapse as states reintroduce border controls and concerns over the rise of populist parties on anti-immigration sentiment.
But some European leaders voiced worries that the deal -- under which the EU would take in one Syrian refugee from Turkish soil in exchange for every Syrian taken back by Turkey from Greece -- would be illegal.
The aim of the "one-for-one" deal is to encourage Syrians to apply for asylum in the EU while they are still on Turkish soil, instead of taking dangerous smugglers' boats across the Aegean Sea.
Lithuanian President Dalia Grybauskaite said the plan was "very complicated, will be very difficult to implement and is on the edge of international law."
Belgian premier Charles Michel evoked concerns over Turkey's rights record and its conflict with Kurdish separatists, adding: "I can't accept negotiations which sometimes look like they are a form of blackmail."
Over dinner, Tusk presented changes to the deal such as a mention that the UNHCR must be involved in deporting people, that women and children should form the bulk of those taken under the scheme and that all asylum applications must be dealt with individually, EU officials said.
The new draft also mentioned that an additional three billion euros in aid for refugees in Turkey would be conditional on an initial three billion euros from a deal last year with Ankara being spent first.
One major hurdle that appeared to have been overcome was opposition from Cyprus, rooted in long-standing tensions with Turkey over Ankara's refusal to recognise its government on the divided island.
Cypriot President Nicos Anastasiades indicated he could be ready to "compromise" on his objections to the EU, opening new "chapters" in Turkey's accession process, after earlier threatening to block the entire deal.
The deal also envisages major aid for Greece, where tens of thousands of refugees are trapped in dire conditions after Balkan countries shut their borders to stop them heading north to richer Germany and Scandinavia.
Highlighting global attention on the issue, Hollywood star and UNHCR goodwill ambassador Angelina Jolie on Thursday visited the island of Lesbos, the principal port of entry for migrants to Europe.
Meanwhile in the bleak camp of Idomeni on the Macedonian-Greek border, Chinese dissident artist Ai Weiwei on Thursday had his hair cut by a migrant barber to draw attention to their plight.