ISTANBUL - German Chancellor Angela Merkel and Turkish Prime Minister Ahmet Davutoglu on Sunday lauded a better understanding between Ankara and the European Union in dealing with the refugee crisis, as thousands more migrants poured into Slovenia headed for western Europe.

Merkel held talks in Istanbul with Davutoglu and was meeting President Recep Tayyip Erdogan on a critical one-day visit which came as Germany was shaken by a bloody knife attack on a pro-refugee politician.

The European Union wants Turkey to do more to tighten its border security and help contain the historic influx of people from Syria, Iraq and other conflict zones seeking shelter in the 28-nation bloc.

In return, Ankara wants greater recognition for its role in hosting over two million Syrian refugees, an increase in financial help and an acceleration of its long-stalled bid for EU membership.

After the talks, Davutoglu praised a "better approach" from the European Union lamenting that "unfortunately Turkey was left alone by the international community in terms of burden sharing." "We are very pleased there is a better approach now. The issue of sharing going forwards is very important," said Davutoglu.

Germany has been Europe's top destination for refugees, most of whom travel through Turkey and the Balkans, and is expecting to register up to a million asylum requests this year.

Davutoglu hailed Merkel for "not turning a blind eye" to the refugee crisis. "Many others said refugees should be sent back (from the EU). She displayed a humanitarian position," he added. Merkel said that the fact Turkey had accomplished the immense task of looking after over two million Syrian refugees on relatively little funding had led to a "migration pressure" which resulted in the influx of migrants into Europe. "Turkey had little international help until now for the huge contribution it has made," said Merkel.

Another 12 people drowned off the Turkish coast on Saturday, and on Sunday the Greek coastguard said five migrants including a baby and two boys had died trying to cross the Aegean Sea.

While many Germans have welcomed the refugees, there has also been a backlash. Support for Merkel's conservatives dipped another point to 37 percent, a new poll said Sunday, while the long-dormant anti-Islamic PEGIDA protest movement has again drawn thousands of followers. As the influx continued, Hungary closed its border with Croatia, forcing the migrants to find a new route to northern Europe through Slovenia and into Austria.

Another 1,000 people crossed from Slovenia into Austria on Saturday and through the night, police said, with most headed for Germany, where debate continued over how to slow the influx.

Police union chief Rainer Wendt told the Welt am Sonntag newspaper Germany should build a fence along its border with Austria.

"If we close our borders this way, Austria will also close its border with Slovenia, and that's exactly the effect we need," he said.

Davutoglu also warned that new fighting around the northern Syrian city of Aleppo risks creating "significant new waves of migration".

He said that "some Iranian militia" and the Lebanese Shiite militant group Hezbollah had been putting pressure on Aleppo, leading to greater fighting coupled with the air strikes by Russia which Turkey has vehemently opposed.