Erdogan said Europe was "dancing in a minefield" by directly or indirectly supporting terrorist groups.
"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," he said in a televised speech.
Facing a backlash from anti-immigration populists across Europe, the EU is desperate to stem the influx but faced legal obstacles to blanket returns of migrants to Turkey.
The summit discussions exposed considerable doubts among member states and EU lawyers over whether a deal could be made legal under international law, and human rights groups denounced the planned agreement as a sell-out of European principles.
The EU leaders pressed Ankara to change its rules to extend international standards of protection to non-Syrian migrants, a condition for Greece to be able legally to return asylum seekers to Turkey.
"All new irregular migrants crossing from Turkey into Greek islands from 20 March, 2016, will be returned to Turkey," the draft joint EU-Turkey statement seen by Reuters said. "This will take place in full accordance with EU and international law, thus excluding any kind of collective expulsion."
It did not say whether this would entail changes in Turkish legislation.
Turkey's four-decade-old dispute with Cyprus had been a key stumbling block. Cypriot President Nicos Anastasiades insisted there could be no opening of new "chapters" in Turkey's EU talks until Ankara allows Cypriot traffic to its sea and airports - a result of a refusal to recognise the Cypriot state.
But the issue was sidestepped because EU leaders agreed to open a negotiating chapter that was not one of the five blocked by Nicosia. An EU official said they would open chapter 33 on budget policy and accelerate preparations for negotiations in other areas. Anastasiades said he was "fully satisfied".