Migrants stand in front of a barrier at the border with Hungary near the village of Horgos, Serbia, September 16, 2015.

Turkey will help stem the flow of migrants to Europe in return for cash, visas and renewed talks on joining the EU in a deal struck on Sunday that the Turkish prime minister called a "new beginning" for the uneasy neighbors.

Leaders of the 28 European Union states met Turkish premier Ahmet Davutoglu in Brussels on Sunday evening to give their collective political blessing to an agreement hammered out by diplomats over the past few weeks.

A spokesman for summit chairman Donald Tusk, the European Council president, said a joint statement had been agreed. He gave no details but a draft seen earlier in the day by Reuters was in line with proposals discussed in the past few days.

A key element is 3 billion euros ($3.2 billion) in EU aid for the 2.2 million Syrian refugees in Turkey, intended to raise living standards and so persuade more to stay put rather than attempt the perilous crossing to the Greek islands and the EU.

Read MoreAfter Paris, is there an EU backlash against migrants?

Also on offer to Ankara, which has driven a hard bargain but also wants to revive relations with its European neighbors as it faces trouble in the Middle East and from Russia, is a "re-energized" negotiating process on Turkish membership of the EU -- even if few on either side expect it to join soon.

And many Turks could also benefit from visa-free travel to Europe's Schengen zone within a year if Turkey meets conditions on tightening its borders in the east to Asian migrants and moves other benchmarks on reducing departures to Europe.

"Today is a historic day in our accession process to the EU," Davutoglu told reporters on arrival. "I am grateful to all European leaders for this new beginning."