The heads of 11 EU states and three non-EU countries met to discuss how to handle growing number of migrants.
More than 9,000 migrants arrived in Greece every day last week, the highest rate so far this year.
Under the deal, Greece will open reception centres with enough room for 30,000 migrants by the end of the year.
The UN’s refugee body, the UNHCR, will provide another 20,000 spaces in the same time.
It will also add reception centres with another 50,000 spaces in Balkan countries, which are the most popular routes north for migrants looking to travel north to Germany and Scandinavia.
Also as part of the deal, leaders also agreed to:
within a week, send 400 police officers to Slovenia, which has struggled with arrival numbers“discourage” the movement of migrants to neighbouring countries’ borders “without informing neighbouring countries”appoint contact officers who can submit information on migrant numbers to other countries and authorities
“This is one of the greatest litmus tests that Europe has ever faced,” said German Chancellor Angela Merkel.
Smaller countries along the Balkan route say their resources are stretched by the number of people arriving.
Bottlenecks have also been exacerbated in part by Hungary closing its borders with Serbia and Croatia, forcing migrants to seek alternative routes north.
Their journeys have been aided by governments who have helped them move to camps or on to the next border.
Before the talks, Croatian Prime Minister Zoran Milanovic dismissed requests to stop moving migrants on.
“That is impossible, whoever wrote this does not understand how things work and must have just woken up from a months-long sleep,” he said.
“Waving them through has to be stopped and that is what is going to happen,” European Commission President Jean-Claude Juncker said after the summit.
Mr Milanovic and Slovenian President Borut Pahor had said Sunday’s talks would be a success only if they agreed to stricter restrictions on migrants travelling from Turkey to Greece.
But no firm new measures on that front were agreed.