Nearly 600,000 migrants have reached the EU by sea so far this year, many of them travelling from Turkey to Greece before seeking to head north.
Turkey made a number of demands in exchange for helping to stem the flow.
In a press conference in Brussels, Donald Tusk, the president of the European Council, said he felt "cautious optimism" over the deal.
Meanwhile, Agence France-Presse reported that an Afghan man was shot dead while trying to enter Bulgaria from Turkey late on Thursday.
He was part of a "large group" of migrants trying to enter Bulgaria, AFP reported, quoting the interior ministry.
In the Brussels summit, European officials agreed to:
Turkey had also asked for â‚¬3bn (Â£2.2bn, $3.4bn) in aid, something German Chancellor Angela Merkel said EU states were considering.
Jean-Claude Juncker, the president of the European Commission, said talks over the sum to be given to Ankara would continue with Turkish officials over the coming days.
Mrs Merkel will travel to Turkey at the weekend.
"There is still a huge amount to do," Mrs Merkel said. "But you cannot say that we've achieved nothing."
EU sources had said several countries were cautious about rushing into an agreement with Turkey too quickly.
Among them were Greece, Cyprus and France.
BBC Europe correspondent Chris Morris says most EU leaders are convinced that efforts to contain the migration crisis will not succeed without closer co-operation with the Turkish government.
The BBC's Matthew Price is sending social media broadcasts from Calais on the EU migration crisis. You can follow his reports here.
The pull of Europe: Five migrant stories
Merkel under pressure: Chancellor's migrant policy faces criticism at home
Focus on Turkey: Why the EU views Syria's northern neighbour as key
Crisis in graphics: Migration numbers explained
Earlier on Thursday, Mrs Merkel said all EU countries must be prepared to send security staff to the bloc's external borders.
She said it would be unfair to ask EU countries seeing the majority of initial migrant entries to secure borders as well.
"It's quite obvious that only a few countries today take the majority of refugees and if these countries now are asked to secure the external borders on top of that, I don't think it would be what we could call a fair distribution of effort," Mrs Merkel said.
She described the current situation as "very disorderly".
In other developments:
593,432
migrants have arrived by sea in 2015, says IOM
3,103
migrants have died trying to cross the Mediterranean
76% arrived in Greece via the eastern route
70.1% of arrivals in Greece were from Syria
10,043 migrants arriving in Italy were unaccompanied children
710,000 migrants have crossed EU borders this year, according to Frontex figures
Turkey is hosting some two million migrants, most of them fleeing the war in neighbouring Syria.
Turkey has also called for the establishment of an international "safe zone" for refugees inside northern Syria - but Mr Tusk said Russia's involvement in Syria made the idea more difficult.
Also in Brussels, the UK Prime Minister David Cameron said he would present four main demands for change in the EU in November. It comes ahead of a promised referendum on the UK's membership of the EU in 2017.
Mr Tusk welcomed Mr Cameron's announcement, adding that the "real negotiations" could start after early November.
EU states have struck an action plan for Turkey that it is hoped will ease the flow of migrants to Europe.