European Union leaders at a summit in Brussels said they agreed on an “action plan” with Turkish President Tayyip Erdogan​ to cooperate on improving the lives of two million Syrian refugees in Turkey.

EU and Turkey are now in agreement on “the exact content of a joint action plan” to stem the flow of refugees arriving to Europe, European Commission President Jean-Claude Juncker said after the refugee summit in Brussels early Friday.

The EU and Turkey also agreed to “speed up” the talks on easing visa restrictions for Turkish citizens, according to Juncker.

The European Union has offered Turkey a possible €3 billion ($4.6 billion) in aid, the prospect of easier travel visas for its people and a glimmer of hope in joining the bloc in exchange for its help stemming the flow of migrants to Europe.

The plan mostly deals with providing more aid to help Turkey manage around 2 million refugees on its soil since Turkey is the main starting point for the hundreds of thousands of refugees crossing the Mediterranean and entering Europe.

“Our intensified meetings with Turkish leaders … in the last couple of weeks were devoted to one goal: stemming the migratory flows that go via Turkey to the EU. The action plan is a major step in this direction,” said summit chairman Donald Tusk, expressing “cautious optimism”.

Many EU officials are also pressuring Turkey to crack down on human smugglers.

German Chancellor stresses Turkey key to solving Europe’s refugee crisis

German Chancellor Angela Merkel stressed Turkey’s “key role” in solving Europe’s refugee crisis as her government tightened asylum rules on Thursday to stem an influx of new arrivals.

Securing cooperation of non-member Turkey is seen as increasingly central to managing the problem by EU leaders as Europe currently struggles to cope with hundreds of thousands of people fleeing war and poverty in the Middle East, Asia and Africa,

“Without a doubt Turkey plays a key role in this situation,” she told the Bundestag lower house of parliament before attending a European Union summit in Brussels later on Thursday.

“Most war refugees who come to Europe travel via Turkey. We won’t be able to order and stem the refugee movement without working together with Turkey,” she added.