DAVOS, Switzerland — German Chancellor Angela Merkel has warned business and political leaders that the ongoing conflict in Libya could have similar ramifications to the war in Syria.

Millions of people have fled Syria over the last five years to escape war, with some of them choosing a new future in the European Union. According to the UNHCR, in 2018, 6.7 million Syrians fled the country. That swathe of refugees, alongside a flow of economic migrants from other parts of the world, sparked division within the 28-member bloc, particularly at the height of the inflow in 2015.

Speaking at the World Economic Forum in Davos, Merkel said the ongoing dispute in Libya could result in a similar situation.

"We have to be vigilant," she said. "And now if we look at Libya we have to be very careful that the same doesn't happen there again."

Libya has seen escalating violence since April, when General Khalifa Haftar tried to take over the country's capital, Tripoli, from the U.N.-recognized government, led by Fayez al-Sarraj. The UNHCR said earlier this month that 46,395 people have been registered as refugees and asylum seekers.

Merkel, who was heavily criticized in 2015 for opening the borders to a large number of refugees, said that at the time "the mistake was not accepting these people … The mistake we made was that we were not sufficiently vigilant prior to that phenomenon."

The German chancellor added that the EU needs to take action to help countries resolving conflict to avoid future problems over large inflows of refugees.

"We have to do more preemptively, do good for those countries in order to prevent these enormous floods of migrants," Merkel said.

At a summit in Berlin on Sunday, Germany, alongside Russia, France and other countries, pledged to end foreign interference and to work toward a permanent cease-fire in Libya. Since the summit, however, the number of foreign-backed mercenaries in the country has reportedly increased and fighting has continued, leading regional experts to warn that any current attempts at a cease-fire are likely to fail.

"We made a first attempt and that's only a first attempt to find a solution for Libya, before Libya itself also falls into this trap of proxy war as we have seen it in Syria," Merkel said.

"Let us all get together when those countries ask us to fight terrorism in their part of the world as we have done this with the overall coalition in Syria," Merkel also told the WEF audience.