Greece’s parliament passed a law on Wednesday toughening penalties for rejected asylum seekers and speeding up returns to their home countries, hardening the country’s stance on migrants after a surge in arrivals at its southern borders this year.

The Mediterranean nation was on the frontline of a 2015-2016 migration crisis when more than a million people fleeing war and poverty in the Middle East and Africa crossed into Europe.

Migrant flows have since fallen. But an upswing in arrivals from Libya through the islands of Crete and Gavdos this year prompted the government to temporarily ban processing asylum applications of migrants coming from North Africa.

The law stipulates that undocumented migrants entering Europe’s southernmost point from third countries deemed safe by the EU and not entitled to asylum must return home or be detained for at least 24 months and face fines of up to 10,000 euros.

The legislation marks a further toughening on migration under the conservative government of Prime Minister Kyriakos Mitsotakis. His administration has built a fence at Greece’s northern borders and boosted sea patrols to deter migrants from crossing since it came to power in 2019.

Migration Minister Thanos Plevris told parliament on Tuesday that the rights of Greeks who want to protect their country outweighed the rights of someone whose asylum was rejected and was staying in Greece illegally.

The U.N. High Commissioner for Refugees (UNHCR) said the law risked penalizing migrants in need of international protection. It suggested the introduction of fast-track asylum procedures could allow for the prompt identification of refugees and non-refugees and their respective administrative treatment.

Greece said it returned hundreds of irregular migrants after it suspended asylum requests in July and planned more flights to Pakistan, Bangladesh and Egypt to return migrants this month.

Human rights groups have accused Athens of forcefully turning back asylum-seekers on its sea and land borders. This year, the European Union border agency said it was reviewing 12 cases of potential human rights violations by Greece.