EU lawmakers on Wednesday voted on a contentious reform of Europe's asylum policies that would harden border procedures and force all the bloc's 27 nations to share responsibility.
The outcome is uncertain. The European Parliament's main political groups back the new EU migration and asylum pact, despite reservations. But the far-right and far-left are opposed, for different reasons.
"The vote will be a close one," admitted EU home affairs commissioner Ylva Johansson.
European Commission Vice President Margaritis Schinas called it a "moment of truth," saying the reform would build "a well-guarded house with more secure external borders and clear rules on who is entitled to enter".
The policy overhaul is broken into 10 pieces of legislation. Each one needs to be adopted, otherwise the entire package will fail.
For more than 160 migrant charities and non-governmental organisations, the pact is a betrayal of European Union values and a hardening of a "Fortress Europe" mentality.
Protesters in the public gallery briefly disrupted the start of the voting, yelling 'This pact kills - vote no!' until the chamber was brought to order.
But the UNHCR refugee agency's chief has endorsed the reform, prepared by the European Commission in the years since massive inflows in 2015 and the fruit of arduous negotiations.
Far-right lawmakers say the overhaul does not go far enough to block access to irregular migrants, whom they accuse of spreading insecurity and threatening to "submerge" European identity.
"These migrant flows just don't stop. We won't allow ourselves to be replaced or submerged," said Jordan Bardella, a lawmaker who heads France's far-right National Rally party whose figurehead is Marine Le Pen.
Hungary is also fiercely opposed. One of its lawmakers, Kinga Gal, predicted the "very bad" pact would result in Europe being "flooded by millions of migrants".
For the far-left, the reforms -- which include building border centres to hold asylum-seekers and sending some to outside "safe" countries -- were incompatible with Europe's commitment to upholding human rights.
It was "a pact with the devil, and we denounce this unanimously," said Damien Careme, a lawmaker from the Greens group.
- 'Problematic elements' -
The mainstream centrist right and left in the parliament exhorted the chamber to swallow misgivings about the pact and to pass it as an improvement over the current situation.
They also warned that failure to pass reforms would boost the far-right, predicted to become a bigger force in the European Parliament following June elections.
"The pact definitely contains problematic elements, risks and weaknesses, and it's dishonest to deny that," said Sophie In 'T Veld, a key figure pushing the package through.
"But it is equally dishonest to claim that this pact is the end of the right to asylum," said the left-leaning lawmaker.
Abir Al-Sahani of Sweden, originally a refugee from Iraq, also called on parliament to overcome resistance from the "barbed-wire right" and the "dreaming left".
The measures, if adopted, would come into force in 2026, after the European Commission sets out in coming months how it would be implemented.
The new border centres would hold irregular migrants while their asylum requests are vetted, and speed up deportations of those deemed inadmissable.
It would also require EU countries to take in thousands of asylum-seekers from "frontline" states such as Italy and Greece. Alternatively, they could provide money or other resources to the under-pressure nations.
A controversial measure is the sending of asylum-seekers to countries outside the EU that are deemed "safe", if the migrant has sufficient ties to that country.
- Deals with neighbours -
The pact has wended through years of thorny talks and compromises ever since the bloc was confronted with large numbers of irregular migrants who arrived in 2015, many from war-torn Syria.
Under current EU rules, the arrival country bears responsibility for hosting and vetting asylum-seekers, and returning those deemed inadmissable. That has put southern states under pressure and fuelled far-right sentiment.
A political breakthrough came in December when a weighted majority of EU countries backed the reforms -- overcoming opposition from Hungary and Poland.
In parallel with the reform, the EU has been multiplying the same sort of deal it struck with Turkey in 2016 to stem migratory flows.
It has reached accords with Tunisia and, most recently, Egypt that are portrayed as broader cooperation arrangements. Many lawmakers have, however, criticised the deals.