The Greek authorities will register the migrants and process asylum applications. Migrants who do not apply for asylum or whose applications are rejected are to be returned to Turkey within two weeks. Under the accord, for every Syrian refugee returned to Turkey, the European Union will resettle one refugee directly from Turkey.

For the tens of thousands of other migrants stuck in camps around Greece, the situation is less clear. Many of them are Syrian and Iraqi nationals who, for the most part, are considered eligible for political asylum and a program that would relocate them across Europe.

Yet governments in several European countries recently began screening Syrians to determine whether the cities they came from were buffeted by conflict or considered “safe,” meaning that not all Syrians will be eligible for asylum.

In addition, around one-third of migrants in Greece are from Afghanistan. After several European countries last month abruptly reclassified them as “economic migrants,” most were disqualified from political asylum, and will most likely be repatriated. That process could be lengthy, even after help from other European Union countries arrives in Greece.

In the meantime, tensions have been flaring in some camps on the mainland as well as in Piraeus, where many migrants have been waiting, often for weeks, to find out if they will be able to cross the borders. On Friday, fights broke out between groups of Afghan and Syrian migrants in Piraeus, after a similar brawl the day before.

At the Idomeni camp on Sunday, Doctors Without Borders said 33 migrants had been treated for injuries inflicted by the Macedonian police as they tried to cross the closed border with Greece.