BRUSSELS — The leaders of Greece and other countries along the main migrant trail to affluent parts of Europe agreed late Sunday to set up holding camps for 100,000 asylum seekers, a move that Chancellor Angela Merkel of Germany said would help slow a chaotic flow of tens of thousands of people seeking shelter from war or simply better lives.

Amid warnings that the European Union risked falling apart if it cannot forge a common response to a largely uncontrolled influx of Syrians, Afghans and others, Ms. Merkel said early Monday in Brussels that Europe “faced one of the greatest litmus tests” in its history and was now moving slowly to ease the crisis.

All the same, she told reporters after an emergency meeting with Eastern and Central European leaders in Brussels that Europe still had a long way to go before it got a grip on its biggest refugee crisis since the end of World War II.