Attending the opening ceremony of the Turkish-German University in Istanbul with Turkish President Recep Tayyip Erdogan, Merkel said Turkey also gives the refugees the hope to rebuild their country when they go back to hometown.
"These efforts deserve our thanks and appreciation," the chancellor noted.
Turkey is hosting over 3.6 million Syrian refugees, costing more than 40 billion dollars up to now.
Ankara agreed to help curb the flow of illegal migrants to Europe under a deal signed with the European Union in March 2016, in return for a total of 6 billion euros in financial aid for the refugees.
The issue has been causing strains in ties between the bloc and Turkey, as Ankara has been urging the European countries to increase the funding. Turkish authorities earlier said only 2.3 billion euros, or 2.6 billion U.S. dollars, in aid from the EU reached Syrian refugees.
For his part, Erdogan said the conflicts in the region have been affecting not only the neighboring countries but also all the European countries, including Germany.
"We hope that the international community should not repeat the mistake that was conducted in Syria, and it must not be the same in Libya," he said.
The Turkish leader also warned that the chaotic environment in Libya might also affect the whole Mediterranean basin if peace is not established as soon as possible.
"Terror groups like Daesh (the Islamic State) and Al-Qaida should not once again grow in this country," Erdogan said. "For this purpose, we need to accelerate the resolution process."
Libya has been torn by a raging civil war between the UN-recognized Government of National Accord and the Libyan National Army.
The international community has been trying to push the warring parties to compromise on a sustainable cease-fire. During the international conference in Berlin last week, the participant countries reiterated that there can be no military solution in Libya.
Erdogan and Merkel will have a meeting later in the day to discuss regional issues, including that related with Syria and Libya, as well as bilateral relations.