Even before Turkey was thrown into crisis by a coup attempt, its deal with the European Union to stop migration westward was under strain: Turks did not get the visa-free travel they were promised, and Greece was overwhelmed with asylum claims that have halted deportations for weeks.

Now critics of the agreement argue Turkey is even more unsafe, and warn the arrangement might collapse altogether — heightening anxiety in neighboring Greece, the main gateway for migrants into the EU.

Amnesty International says it has gathered evidence that people who have been detained in President Recep Tayyip Erdogan's sweeping purge of suspected sympathizers of the attempted coup on July 15-16 are being beaten and tortured.

"With allegations of torture in detention, a crackdown on freedom of expression and a general roll back of rights, the EU cannot expect to outsource its refugee responsibilities to Turkey," the rights group's deputy Europe director Gauri van Gulik told the AP.

"Amnesty and other groups have already demonstrated Turkey is not a safe country to return refugees to. And the events of last week are only likely to exacerbate the situation."

More than a million migrants crossed into the continent last year, mostly from Turkey to nearby Greek islands. The number of arrivals fell dramatically after Ankara reached an agreement with the EU in March, sweetened with hefty financial support and promises to ease European travel restrictions for Turks. NATO was allowed to patrol the eastern Aegean, while migrants arriving after March 20 were detained for deportation.

Migration expert Brad Blitz said that as far sending refugees back, the deal is now probably doomed.

"Quite honestly, I don't see how anyone could claim that Turkey is a safe country. I didn't think it was a safe country beforehand in terms of returning people, but this (purge) is so blatant with thousands of people arrested and allegations of torture ... The situation there is so unstable that you might see Turkey journalists and academics coming across the Aegean with migrants," said Blitz, a professor of international politics at Middlesex University in London.

"It will put more pressure on Greece," he said.

More than 57,000 migrants are stranded in Greece, with 8,500 of them awaiting possible deportation on Lesbos, Chios and other islands facing Turkey. So far, fewer than 500 have been sent back, and none since mid-June as authorities remain bogged down by asylum applications.

According to government data, migrant arrivals have increased slightly to about 100 a day — roughly double the number seen in recent weeks, but still far lower that massive levels seen last fall when daily arrivals topped 3,000.

In past weeks, violence has repeatedly broken out at overcrowded deportation camps on the islands, where some locals have staged protests, angered by the effect of the crisis on tourism.

In Brussels, EU officials have said little about the prospects of the migration agreement.

EU Commission spokesman Margaritis Schinas told reporters Friday that "it goes without saying that the commission monitors the situation in Turkey."

"For the time being, we maintain our position. The guarantees (provided by Ankara) are valid," he said.

The upheaval in Turkey is likely to be felt in Greece in the next two months, argues Thanos Dokos, director of the Hellenic Foundation for European and Foreign Policy, an Athens-based think tank.

"Now we now have a chilling of relations between the EU and Turkey because of the purges and the debate about the death penalty and I suspect Mr. Erdogan will not be in any mood to make the life of EU countries easier when it comes to the refugee situation," Dokos said.

"So we might see in the next couple of months a return to the situation of late 2015 and early 2016 when larger numbers of people were crossing the Aegean every day. Saying larger numbers, I don't think we will go back to the 3,000 people per day."

___

Becatoros reported from Istanbul, Turkey. Raf Casert in Brussels contributed. Follow them at http://www.twitter.com/dgatopoulos , http://www.twitter.com/ElenaBec and http://twitter.com/rcasert