Leaders of the European Union and Turkey were set to sign an agreement on Sunday offering Ankara cash and closer ties in return for help in stemming the flow of migrants to Europe, draft conclusions of their summit showed.

Aware of a sense of desperation in Europe for a solution to a crisis that has called into question the future of its passport-free travel zone, Ankara has been driving a hard bargain.

Diplomats said the 28 EU governments had struggled through Saturday to agree a final offer.

The draft deal seen by Reuters made clear the nature of the trade-off, involving Turkish help in handling the flow of migrants to the EU, expected to reach 1.5 million people this year alone, and the EU offering cash and restarting talks on EU accession. “Both sides will ... with immediate effect, step up their active cooperation on migrants..., preventing travel to Turkey and the EU, ensuring ... readmission provisions and swiftly returning migrants who are not in need of international protection to their countries of origin,” the draft said.

Turkish Prime Minister Ahmet Davutoglu, meeting the 28 EU national leaders for three hours from 1500 GMT, said on arrival for the talks in Brussels that it was a “new beginning” for Turkey’s efforts to become an EU member, stalled for 10 years.

“Today is a historic day in our accession process to the EU,” Davutoglu told reporters. “I am grateful to all European leaders for this new beginning,” he said.

Summit chairman Donald Tusk, however, stressed that the meeting was primarily about stemming the flow of migrants.

“I have called this summit to decide in the first place what the EU and Turkey must do together to cope with the migration crisis. Our main goal is to stem the flow of migrants to Europe,” Tusk said.

The Europeans, none more so than German Chancellor Angela Mer-kel, are under pressure to manage the biggest influx of people since World War II, the bulk of them to Germany.