Thousands of migrants and refugees camped out at Greece's largest port near Athens have been given two weeks to move to army-built camps voluntarily or be expelled by force, authorities said.
The warning issued on Thursday came as nearly a third of the 52,000 migrants stranded in Greece by European border closures are refusing to move to organised shelters and remain camped out at the port of Piraeus and at the northern border with Macedonia.
More than 4,000 migrants remain at Piraeus - an important site for Greece's vital tourism industry.
"Every effort will be exhausted to persuade refugees and immigrants that it is in their own interest for them to move," a statement from the Greek coast guard said.
Athens has toughened its position toward migrants since a March 20 agreement between the European Union and Turkey went into effect.
Some 4,000 migrants and refugees who reached the Greek islands from Turkey after that date are in detention, with most due to be sent back to Turkish ports. The deportations started on Monday and are expected to resume Friday.
More than a million refugees and migrants reached the EU last year, most traveling through Greece and across the Balkans to central Europe.
At Piraeus on Thursday, Interior Ministry officials and translators spent hours trying to persuade migrants to move to a new camp in northern Greece, showing them aerial photographs of the site and explaining what facilities are available.
"We are trying to explain that the new camps have good facilities and that people there will be able to fill out their asylum applications there," volunteer translator Ilias Iakovou said. "But people are afraid to go because they fear they will be cut off and will run out of money. They feel safe if they are near Athens."
Iranian migrant Ahmad Devidjan said he was not sure whether he should move.
"I've been in Greece for 19 days. I went two times to the border with Macedonia, but it was closed. Now I'm back here," he said. "I have a brother in Germany. He's a teacher. I want to go there."
Turkish president Recep Tayyip Erdogan said his country will not implement a deal reached with the European Union on the return of migrants from Greece if the EU does not fulfil its obligations toward Turkey.
Under the deal, Turkey agreed to take back migrants who reached Greece illegally from March. For every Syrian returned, Europe agreed to take a Syrian refugee from Turkey to be resettled in an EU country. Turkey is also set to receive funds to spend on the refugees, visa-free travel for Turkish citizens and sped-up EU membership talks.
Mr Erdogan said on Thursday: "If the European Union does not take the steps it needs to take, if it does not fulfil its pledges, then Turkey won't implement this agreement."
The Turkish leader did not elaborate.
Meanwhile, the Vatican confirmed Pope Francis will meet with refugees on the Greek island of Lesbos on April 16.
The Vatican said that Francis had accepted an invitation to visit by the spiritual leader of the world's Orthodox Christians, Ecumenical Patriarch Bartholomew, and the Greek president. Bartholomew will be in Lesbos as well.
Francis, the son of Italian immigrants to Argentina, has been outspoken about Europe's moral obligation to welcome refugees.