A Turkish-flagged cargo ship carrying about 400 migrants is sailing slowly off the island of Karpathos after sending out a distress signal on Friday and will dock at a Greek port to disembark the migrants, a Greek coast guard official said on Saturday.

The vessel could not sail independently and was being towed by a Greek coastguard vessel, the official said. It sent the distress signal near the island of Crete with the coast guard quoting passengers as saying it had sailed from Turkey.

“The ship is sailing very slowly off Karpathos island, carrying mostly Afghan migrants. It will dock at a Greek port which has not been decided yet,” the official told Reuters, declining to be named.

Karpathos is the second largest of the Dodecanese islands in the southeastern Aegean Sea.

On Friday Greece’s Shipping Ministry had asked Turkey to accept the vessel’s return to Turkey, a migration ministry official said. Greece’s migration minister had contacted Turkish authorities and the EU Commission to resolve the matter.

Greece is the main route into the European Union for asylum-seekers arriving from Turkey. The number of arrivals has fallen sharply since 2016 after the EU and Ankara agreed a deal to stop migrants from crossing to Greece.

Nearly 1 million people, mainly Syrian refugees, arrived in the EU in 2015 after crossing to Greek islands close to Turkey. Since the Taliban takeover of Afghanistan in August, many EU states fear a replay of that crisis.

On Tuesday, four migrants, three of them children, drowned after a boat in which they and 23 others were trying to cross from Turkey to Greece sank off the island of Chios.