It was shortly after midnight, after hours of negotiations, but still much earlier than many had anticipated, when news came in that leaders of the EU's 28 member states had agreed a position.

Most prime ministers and presidents left the summit venue without any comment.

Still, it seemed that any resistance from Cyprus had been broken, any concerns about human rights– more or less – addressed, and the problem posed by visa liberaliziation almost, if not entirely, solved.

German Chancellor Angela Merkel was one of the few to give what she called a "sketchy overview": Negotiations had been held in a "constructive atmosphere," demands such as lifting visa restrictments on Turkish citizens travelling to Europe had been discussed, but obviously, while cornerstones of a EU-Turkey deal had been discussed, this had only been a first step.

With that, Merkel smiled, adding that she hoped to see the press corps again "later today."

Read our live coverage of the summit.

Building on earlier proposal

Over a dinner of shellfish, chicken and orange parfait, EU leaders had talked about a plan which the Turkish prime minister Ahmet Davutoglu had first presented to EU leaders on March 7.

According to this proposal, Turkey would take in all migrants illegaly arriving in Greece via the Aegean Sea, starting at a yet to be determined date. For any Syrian sent back to Turkey, the EU would in return allow one Syrian stranded in a Turkish refugee camp to legally enter the EU.

EU leaders hope that such an arrangement would act as a deterrent, because any migrant illegally arriving on European shores would have to join the end of the queue. At least in theory, what EU politicians like to call the "business model" of people smugglers, would thus be destroyed.

Over a million migrants entered the EU in 2015, with Germany the favored destination for the vast majority of them

With over one million migrants coming to the EU in 2015, and the bloc proving incapable of agreeing a common position to stem the flow over months, leaders seem almost desperate to clinch a deal.

Dutch Prime Minister Mark Rutte, whose country is currently holding the rotating EU presidency, said a deal with Turkey would stop the illegal crossing of boats to Greece "within three or four weeks."

At a high price

But the proposed deal does carry a price tag: In addition to the three billion euros ($3.33 billion) already pledged by the EU, Turkey demanded an additional three billion euros to take care of the migrants.

"Turkey is really asking for a lot," said Belgian Prime Minister Charles Michel.

That said, hours before EU Council President Donald Tusk was scheduled to present the bloc's position to the Turkish prime minister, money seemed unlikely to become the deal-breaker.

Germany's Merkel at least indicated there was a "readiness to put additional money on the table."

However, she didn't go into any details as to when and under which conditions the EU would up its financial pledges – details which might well make the deal much less palatable to Turkey.

Minority rights in exchange for visa liberalization

It was also not immediately clear what the EU had agreed with regard to another key Turkish demand: that of lifting all visa restrictions on Turkish citizens travelling to the passport-free Schengen zone by the summer.

It is a demand particularly close to the heart of Turks, but France, facing a presidential election next year and a resurgence of the right-wing National Front, was one of the EU members showing themselves less than eager to give in to it.

"Turkey has to meet all 72 requirements set out by the EU," stressed French President Francois Hollande, "and there won't be visa liberalization until these are in fact met."

The requirements include revising legislation so as to guarantee minority rights.

Merkel for her part remained vague, saying only that "certain legal prerequisites" would have to be met, and "certain standards of international law" would have to be incorporated into Turkish legislation before visa restrictions could be lifted.

European conservatives, who hold a majority in the European Parliament and whose vote is needed in order to lift visa restrictions, have also said they're not willing to cut the Turks any slack on meeting requirements.

Speeding up EU membership negotiations

Money and visa liberalization aside, Turkey wants to speed up negotiations on joining the EU. Talks on this started in 2005, but have progressed little, with the biggest obstacle the delicate relationship between Turkey and EU-member Cyprus.

Turkey invaded the northern half of the island back in 1974, and has since refused to recognize the Cypriot government. Since implementing a trade deal including the opening of Turkey's ports and airports to Cypriot traffic would have amounted to recognizing the government, Turkey never did make good on this commitment – leading the EU to suspending further accession talks.

Small surprise then Cyprus said it was opposed to a deal, unless the Turks moved on this question – and earlier this week, EU Council President Donald Tusk had had to admit there could be no agreement without Cyprus' consent.

But arriving at the summit, Cypriot President Nicos Anastasiades seemed to imply a solution could be found after all.

'Don't trade refugees'

Human rights organizations are concerned about another aspect of the deal, namely that of returning all migrants to Turkey. After the March 7 summit, the UNHCR expressed concern at the planned " blanket return of anyone from one country to another," and the Council of Europe called the deal "illegal."

The EU Commission then hastily assured that of course, each person's asylum request would be assessed invidually before that person would be returned to Turkey – a statement echoed by Angela Merkel after Thursday's meeting.

Before the summit, human rights organizations like Amnesty International had called on EU leaders not to start engaging in a "refugee trade" with Turkey.

Deal in sight

But after EU leaders had left the summit venue to get a few hours of sleep, it seems that any resistance among EU members to clinch the deal had been overcome.

"We need to put all our efforts into achieving an agreement with Turkey," Merkel reminded her counterparts.

Whether Turkey is ready to do the same, will, according to Austrian Chancellor Werner Faymann, be known around lunch time on Friday.