ATHENS (Reuters) - German Chancellor Angela Merkel said on Friday a deal between the European Union and Turkey to stem massive migrant flows is dysfunctional and criticized Greece’s legal system for underperforming on deportations.

Slideshow ( 2 images )

The EU and Turkey struck an accord in 2016 after more than a million refugees and migrants arrived from the Middle East and Africa to Greece’s shores the year before.

Under the agreement, anyone crossing to Greece from Turkey who does not qualify for asylum must be sent back and for every Syrian refugee being returned to Turkey from the Greek islands, another will be resettled to the EU.

“Unfortunately it’s not working properly,” Merkel said in response to questions from students at the German School of Athens. “As it is not working, we have this pressurized situation on the Greek islands.”

Management of the refugee crisis has bruised unity in the 28-nation bloc: Mediterranean countries coping with most arrivals often feel helpless while wealthier northern nations complain people reach their soil unchecked and those on the EU’s eastern flank refuse to host new arrivals.

Merkel concluded a two-day visit to Athens where she also met with Greek Prime Minister Alexis Tsipras.

“The Greek legal system is very complicated and somehow the sending back (of migrants) is not working,” she told the students.

“Everyone knows once you’re on a Greek island, you can get to the mainland, and once you’re on the mainland you can then somehow get to Germany, Sweden, Austria or somewhere else, so then we are supporting illegal migration,” she said.

Merkel said she spoke to Tsipras about those issues.

“There are many Iraqis, many Afghans and many others for whom we have no solution in the deal. Europe needs to take care of that too,” she said. “It’s a bit complicated but in the long term it’s not acceptable that some European countries say this problem doesn’t interest us.”