By Humeyra Pamuk and Philip Blenkinsop
BRUSSELS (Reuters) - Turkish President Tayyip Erdogan accused the European Union of hypocrisy over migrants, human rights and terrorism on Friday as his prime minister negotiated in Brussels over a deal to stem an influx of migrants and refugees into Europe.
Reacting to EU demands that Turkey change its laws to grant wider protection to migrants and to criticism of his crackdown on media freedom and domestic opponents, Erdogan said Europe was "dancing in a minefield" by directly or indirectly supporting terrorist groups.
Europeans needed to look at their own record on migrants before telling Turkey what to do, he said, adding that Ankara would only listen to EU criticism on rights when it was correct.
"At a time when Turkey is hosting three million, those who are unable to find space for a handful of refugees, who in the middle of Europe keep these innocents in shameful conditions, must first look at themselves," Erdogan said in a speech broadcast on television.
His combative tone contrasted with optimistic comments by Prime Minister Ahmet Davutoglu when he arrived for talks with EU officials on a package of political and financial rewards which EU leaders agreed on Thursday in return for Turkey's willingness to take back all illegal migrants who cross into Europe.
The EU conditions fell short of Turkey's demands for more money, faster visa-free travel for Turks in Europe and an acceleration of Ankara's long-stalled EU membership talks.
After more than a million people fleeing war and poverty in the Middle East and beyond poured into Europe last year, most ending up in Germany, the EU is desperate to stem the flow but faces legal objections to blanket returns of migrants to Turkey.
Hence the EU leaders are insisting that Turkey legislate to extend international standards of protection to non-Syrian migrants, a condition for Greece to be able legally to return asylum seekers.
After Davutoglu held a two-hour meeting with Dutch Prime Minister Mark Rutte, whose country holds the rotating EU presidency, and top EU officials the talks were suspended to allow for work on technical details.
"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 the talks.
All 28 EU leaders were due to meet the Turkish premier over lunch to conclude a deal, but officials warned that could slip.
NO GUARANTEED HAPPY END
German Chancellor Angela Merkel, who devised the outlines of the plan with Davutoglu 10 days ago, and French President Francois Hollande both expressed caution on Thursday about the chances for an agreement.
"I can't guarantee you a happy ending," Hollande told reporters.
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 summit discussions exposed considerable doubts among member states and within EU institutions over whether a deal could be made either legal under international law or workable.
EU leaders have given negotiators a mandate to conclude an accord whereby Turkey would take back all migrants who reach Greek islands from its coast. In return the EU would take in thousands of Syrian refugees directly from Turkey.
Much of the debate, Merkel said, focused on ensuring that a plan that has outraged human rights groups could guarantee that those returned to Turkey would receive protection.
Turkey's human rights record has drawn growing criticism amid a crackdown on Kurdish separatists, arrests of critical journalists and the seizure of its best-selling newspaper.
A major problem is Turkey's four-decade-old dispute with EU member Cyprus, whose President Nicos Anastasiades insisted there could be no opening of new "chapters" in Turkey's EU membership talks until Ankara allows Cypriot traffic to its sea and airports - a result of a refusal to recognize the Cypriot state.
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.
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.
Ankara's central objective - visa-free travel for Turks to Europe by June - will depend on Turkey meeting 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 fulfill all 72 prior conditions.
Merkel said leaders had agreed no date to start the scheme but diplomats said the aim was to set a March 20 cut-off date after which anyone arriving in Greece would eventually be sent back.
(Additional reporting by Renee Maltezou, Robin Emmott, Paul Taylor, Gabriela Baczynska, Julia Fioretti, Jan Strupczewski and Elizabeth Pineau in Brussels; writing by Robin Emmott and Paul Taylor; Editing by Gareth Jones)