Turkey's prime minister raised hopes of a deal with EU leaders on Friday to help stem the influx of migrants into Europe, but France and Germany warned of difficult talks as both sides grapple with how to send refugees back from Greece.

After European Union leaders spent Thursday arguing over their negotiating position, Ahmet Davutoglu arrived for an early meeting with the prime minister of the Netherlands — holder of the bloc's rotating presidency — and senior EU officials before a summit with the heads of state and government to forge a deal.

"Of course the EU and Turkey have the same goal, the same objective to help Syrian refugees ... I am sure ... we will be achieving our goal," Davutoglu told reporters before going into talks he hopes will yield financial and political concessions for Ankara.

However, Davutoglu also hinted in his comments at sensitive issues in the deal to tackle Europe's migration crisis such as whether it would respect international law and how far the EU would want to go to speed up Turkey's bid to join the bloc.

German Chancellor Angela Merkel, who devised the outlines of the plan with Davutoglu, has said Friday's meeting will not be easy and French President Francois Hollande echoed her caution.

"I can't guarantee you a happy ending," he told reporters after Thursday's talks.

A senior Turkish official told Reuters that Davutoglu would press the EU to open up new areas of negotiation on its long-stalled bid to join the bloc, despite a veto threat by Cyprus.

The EU discussions have also revealed considerable doubts among member states over whether a deal could be made either legal under international law or workable.

Over dinner on Thursday, EU leaders gave negotiators a mandate to conclude an accord withTurkey by which it would take back all migrants who reach Greek islands off its coast.

In return the EU would take in Syrian refugees direct from Turkey, increase aid for Syrians there, speed Ankara's EU membership process and a scheme to let Turks visit Europe without visas.

Much of the debate, Merkel said, focused on ensuring that a plan that has outraged human rights agencies could ensure that those returned to Turkey would have their rights to asylum protected. Turkey has a patchy and worsening record on protecting human rights.

"An agreement with Turkey cannot be a blank cheque," Belgian Prime Minister Charles Michel warned, echoing many colleagues who face complaints that Europe is selling out to anti-immigrant nationalists at home by outsourcing its problems to the Turks.

CYPRIOT ANGER

Cyprus' President Nicos Anastasiades arrives at a European Union leaders summit over migration in Brussels, Belgium, March 17, 2016. REUTERS/Francois Lenoir

After EU leaders told European Council President Donald Tusk where they could give ground and where they had limits, Anastasiades said he could veto a deal.

There is anger in Nicosia at Merkel for appearing to make Davutoglu an offer last week without having consulted Cyprus at a time when talks on reunification with the Turkish-backed north of the island are at a delicately hopeful stage.

Tusk made clear Cypriot interests must be respected.

After a year in which more than a million people have arrived in Europe fleeing war and poverty in the Middle East and beyond, EU countries are looking desperately to Turkey to seal its coastline and stem the flow.

One senior EU official said that a lack of legal clarity in Turkey on the status of refugees from countries other than Syria — notably large numbers of Iraqis and Afghans — was a serious sticking point to Greece sending such people back.

EU officials said Greece also needed time to set up legal and administrative structures to carry out the deportations and grant migrants individual asylum and appeal hearings.

Diplomats said talks among the EU states had watered down inducements to Turkey and included new safeguards intended to overcome legal objections to sending back migrants.

Ankara's central objective — visa-free travel for Turks to Europe by June — will depend on Turkeymeeting a raft of long-standing EU criteria. With French voters alarmed at the idea of nearly 79 million Muslim Turks free to travel, Hollande stressed the need to fulfil all 72 prior conditions.

Leaders set no date to start the scheme. Some want all those arriving on Greek beaches from next Monday to be held for deportation, but Athens says it needs weeks to prepare. However, any delay may trigger a rush to cross before Europe shuts down.